-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add deploy script and integration test setup (#49)
* Add deploy script with some placeholder values --------- Co-authored-by: Ben DiFrancesco <[email protected]>
- Loading branch information
1 parent
6b2d20e
commit 3ed27c3
Showing
6 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
MAINNET_RPC_URL= | ||
FOUNDRY_PROFILE=default | ||
DEPLOYER_PRIVATE_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ on: | |
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }} | ||
|
||
jobs: | ||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
// slither-disable-start reentrancy-benign | ||
|
||
pragma solidity 0.8.23; | ||
|
||
contract DeployInput { | ||
address constant UNISWAP_GOVERNOR_TIMELOCK = 0x1a9C8182C09F50C8318d769245beA52c32BE35BC; | ||
address constant UNISWAP_V3_FACTORY_ADDRESS = 0x1F98431c8aD98523631AE4a59f267346ea31F984; | ||
// TODO not finalized: currently WETH | ||
address constant PAYOUT_TOKEN_ADDRESS = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; | ||
address constant STAKE_TOKEN_ADDRESS = 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984; | ||
// TODO not determined yet | ||
uint256 constant PAYOUT_AMOUNT = 10e18; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
pragma solidity 0.8.23; | ||
|
||
import {Vm, Test, console2} from "forge-std/Test.sol"; | ||
import {Deploy} from "script/Deploy.s.sol"; | ||
import {DeployInput} from "script/DeployInput.sol"; | ||
|
||
import {V3FactoryOwner} from "src/V3FactoryOwner.sol"; | ||
import {UniStaker} from "src/UniStaker.sol"; | ||
|
||
contract DeployScriptTest is Test, DeployInput { | ||
function setUp() public { | ||
vm.createSelectFork(vm.rpcUrl("mainnet")); | ||
} | ||
|
||
function testFork_DeployStakingContracts() public { | ||
Deploy _deployScript = new Deploy(); | ||
_deployScript.setUp(); | ||
(V3FactoryOwner v3FactoryOwner, UniStaker uniStaker) = _deployScript.run(); | ||
|
||
assertEq(v3FactoryOwner.admin(), UNISWAP_GOVERNOR_TIMELOCK); | ||
assertEq(address(v3FactoryOwner.FACTORY()), address(UNISWAP_V3_FACTORY_ADDRESS)); | ||
assertEq(address(v3FactoryOwner.PAYOUT_TOKEN()), PAYOUT_TOKEN_ADDRESS); | ||
assertEq(v3FactoryOwner.PAYOUT_AMOUNT(), PAYOUT_AMOUNT); | ||
assertEq(address(v3FactoryOwner.REWARD_RECEIVER()), address(uniStaker)); | ||
|
||
assertEq(address(uniStaker.REWARDS_TOKEN()), PAYOUT_TOKEN_ADDRESS); | ||
assertEq(address(uniStaker.STAKE_TOKEN()), STAKE_TOKEN_ADDRESS); | ||
assertEq(uniStaker.admin(), UNISWAP_GOVERNOR_TIMELOCK); | ||
assertTrue(uniStaker.isRewardsNotifier(address(v3FactoryOwner))); | ||
} | ||
} |