diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index c8aaa6f..d9c6320 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -2,6 +2,7 @@ pragma solidity 0.8.26; import {IOracle, Oracle} from '@defi-wonderland/prophet-core/solidity/contracts/Oracle.sol'; + import { BondEscalationModule, IBondEscalationModule @@ -112,7 +113,7 @@ contract Deploy is Script { disputeDisputeWindow = 2 weeks; } - function run() public { + function deploy() public { vm.startBroadcast(); // Precompute address of `EBORequestCreator` @@ -121,50 +122,67 @@ contract Deploy is Script { // Deploy `Oracle` oracle = new Oracle(); + vm.label(address(oracle), 'Oracle'); console.log('`Oracle` deployed at:', address(oracle)); // Deploy `Arbitrable` arbitrable = new Arbitrable(arbitrator, council); + vm.label(address(arbitrable), 'Arbitrable'); console.log('`Arbitrable` deployed at:', address(arbitrable)); // Deploy `EBORequestModule` eboRequestModule = new EBORequestModule(oracle, _precomputedEBORequestCreator, arbitrable); + vm.label(address(eboRequestModule), 'EBORequestModule'); console.log('`EBORequestModule` deployed at:', address(eboRequestModule)); // Deploy `BondedResponseModule` bondedResponseModule = new BondedResponseModule(oracle); + vm.label(address(bondedResponseModule), 'BondedResponseModule'); console.log('`BondedResponseModule` deployed at:', address(bondedResponseModule)); // Deploy `BondEscalationModule` bondEscalationModule = new BondEscalationModule(oracle); + vm.label(address(bondEscalationModule), 'BondEscalationModule'); console.log('`BondEscalationModule` deployed at:', address(bondEscalationModule)); // Deploy `ArbitratorModule` arbitratorModule = new ArbitratorModule(oracle); + vm.label(address(arbitratorModule), 'ArbitratorModule'); console.log('`ArbitratorModule` deployed at:', address(arbitratorModule)); // Deploy `EBOFinalityModule` eboFinalityModule = new EBOFinalityModule(oracle, _precomputedEBORequestCreator, arbitrable); + vm.label(address(eboFinalityModule), 'EBOFinalityModule'); console.log('`EBOFinalityModule` deployed at:', address(eboFinalityModule)); // Deploy `HorizonAccountingExtension` address[] memory _authorizedCallers = _instantiateAuthorizedCallers(); - horizonAccountingExtension = new HorizonAccountingExtension( - horizonStaking, oracle, graphToken, arbitrable, _MIN_THAWING_PERIOD, _MAX_USERS_TO_CHECK, _authorizedCallers - ); + horizonAccountingExtension = new HorizonAccountingExtension({ + _horizonStaking: horizonStaking, + _oracle: oracle, + _grt: graphToken, + _arbitrable: arbitrable, + _minThawingPeriod: _MIN_THAWING_PERIOD, + _maxUsersToCheck: _MAX_USERS_TO_CHECK, + _authorizedCallers: _authorizedCallers + }); + vm.label(address(horizonAccountingExtension), 'HorizonAccountingExtension'); console.log('`HorizonAccountingExtension` deployed at:', address(horizonAccountingExtension)); // Deploy `CouncilArbitrator` councilArbitrator = new CouncilArbitrator(arbitratorModule, arbitrable); + vm.label(address(councilArbitrator), 'CouncilArbitrator'); console.log('`CouncilArbitrator` deployed at:', address(councilArbitrator)); // Deploy `EBOAccessModule` eboAccessModule = new EBOAccessModule(oracle, arbitrable, horizonAccountingExtension); + vm.label(address(eboAccessModule), 'EBOAccessModule'); console.log('`EBOAccessModule` deployed at:', address(eboAccessModule)); // Deploy `EBORequestCreator` IOracle.Request memory _requestData = _instantiateRequestData(); eboRequestCreator = new EBORequestCreator(oracle, epochManager, arbitrable, _requestData); + vm.label(address(eboRequestCreator), 'EBORequestCreator'); console.log('`EBORequestCreator` deployed at:', address(eboRequestCreator)); // Assert that `EBORequestCreator` was deployed at the precomputed address @@ -178,7 +196,6 @@ contract Deploy is Script { _requestData.nonce = 0; // Set requester and modules - _requestData.requester = address(eboRequestCreator); _requestData.accessModule = address(eboAccessModule); _requestData.requestModule = address(eboRequestModule); diff --git a/test/integration/arbitrum/IntegrationBase.t.sol b/test/integration/arbitrum/IntegrationBase.t.sol index 7a961ba..f23929d 100644 --- a/test/integration/arbitrum/IntegrationBase.t.sol +++ b/test/integration/arbitrum/IntegrationBase.t.sol @@ -38,7 +38,7 @@ contract IntegrationBase is Deploy, Test, Helpers { // Run deployment script super.setUp(); - run(); + deploy(); // Set user accounts _requester = makeAddr('requester'); diff --git a/test/unit/Deploy.t.sol b/test/unit/Deploy.t.sol index 4cde5cb..3dd8a3a 100644 --- a/test/unit/Deploy.t.sol +++ b/test/unit/Deploy.t.sol @@ -66,7 +66,7 @@ contract UnitDeploy is Test { function test_RunRevertWhen_TheGraphAccountsAreNotSetUp() public { // it should revert vm.expectRevert(); - deploy.run(); + deploy.deploy(); } modifier givenTheGraphAccountsAreSetUp() { @@ -90,12 +90,12 @@ contract UnitDeploy is Test { // it should revert vm.expectRevert(Deploy.Deploy_InvalidPrecomputedAddress.selector); - deploy.run(); + deploy.deploy(); } function test_RunWhenPrecomputedAddressIsCorrect() public givenTheGraphAccountsAreSetUp { uint256 _nonceBefore = vm.getNonce(tx.origin); - deploy.run(); + deploy.deploy(); uint256 _nonceAfter = vm.getNonce(tx.origin); // it should deploy all contracts using a single EOA