-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add in vesting tests and new timelock vesting deploy script
- Loading branch information
1 parent
e9eb5df
commit 26f1cf9
Showing
6 changed files
with
315 additions
and
46 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,44 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity 0.8.21; | ||
|
||
import { TimelockController } from "@openzeppelin/contracts/governance/TimelockController.sol"; | ||
import { ERC20 } from "@solmate/tokens/ERC20.sol"; | ||
|
||
import "forge-std/Script.sol"; | ||
|
||
/** | ||
* @dev Run | ||
* `source .env && forge script script/prod/CreateVestingTimelock.s.sol:CreateVestingTimelockScript --rpc-url $MAINNET_RPC_URL --private-key $PRIVATE_KEY —optimize —optimizer-runs 200 --with-gas-price 25000000000 --verify --etherscan-api-key $ETHERSCAN_KEY --slow --broadcast` | ||
* @dev Optionally can change `--with-gas-price` to something more reasonable | ||
*/ | ||
contract CreateVestingTimelockScript is Script { | ||
// TimelockController private controller = TimelockController(payable(0xAa71f75fb6948a6c814A28675241FC5E3bCaC355)); | ||
address private somm = 0xa670d7237398238DE01267472C6f13e5B8010FD1; | ||
address private dest = 0xA9962a5BfBea6918E958DeE0647E99fD7863b95A; | ||
address private devOwner = 0x552acA1343A6383aF32ce1B7c7B1b47959F7ad90; | ||
|
||
TimelockController private timelock; | ||
|
||
function run() external { | ||
uint256 minDelay = 2 * 365 days; | ||
address[] memory proposers = new address[](2); | ||
address[] memory executors = new address[](1); | ||
address admin = dest; | ||
|
||
proposers[0] = devOwner; | ||
proposers[1] = dest; | ||
|
||
executors[0] = dest; | ||
|
||
bytes memory payload0 = abi.encodeWithSelector(ERC20.transfer.selector, dest, 400_000e6); | ||
bytes memory payload1 = abi.encodeWithSelector(TimelockController.updateDelay.selector, 300); | ||
|
||
vm.startBroadcast(); | ||
timelock = new TimelockController(minDelay, proposers, executors, admin); | ||
|
||
timelock.schedule(somm, 0, payload0, hex"", hex"", 2 * 365 days); | ||
timelock.schedule(address(timelock), 0, payload1, hex"", hex"", 2 * 365 days); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,41 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity 0.8.21; | ||
|
||
import { PriceRouter } from "src/modules/price-router/PriceRouter.sol"; | ||
import { Deployer } from "src/Deployer.sol"; | ||
import { VestingSimple } from "src/modules/vesting/VestingSimple.sol"; | ||
import { VestingSimpleAdaptor } from "src/modules/adaptors/VestingSimpleAdaptor.sol"; | ||
|
||
import { MainnetAddresses } from "test/resources/MainnetAddresses.sol"; | ||
|
||
import "forge-std/Script.sol"; | ||
|
||
/** | ||
* @dev Run | ||
* `source .env && forge script script/prod/DeployVestingContracts.s.sol:DeployVestingContractsScript --rpc-url $MAINNET_RPC_URL --private-key $PRIVATE_KEY —optimize —optimizer-runs 200 --with-gas-price 25000000000 --verify --etherscan-api-key $ETHERSCAN_KEY --slow --broadcast` | ||
* @dev Optionally can change `--with-gas-price` to something more reasonable | ||
*/ | ||
contract DeployVestingContractsScript is Script, MainnetAddresses { | ||
Deployer public deployer = Deployer(deployerAddress); | ||
|
||
function run() external { | ||
bytes memory creationCode; | ||
bytes memory constructorArgs; | ||
|
||
vm.startBroadcast(); | ||
|
||
// Deploy Vesting Simple Adaptor | ||
creationCode = type(VestingSimpleAdaptor).creationCode; | ||
deployer.deployContract("VestingSimpleAdaptor V 1.0", creationCode, constructorArgs, 0); | ||
|
||
// Deploy vesting contracts. | ||
creationCode = type(VestingSimple).creationCode; | ||
constructorArgs = abi.encode(GHO, 7 days, 0.01e18); | ||
deployer.deployContract("VestingSimple GHO 7 days V0.0", creationCode, constructorArgs, 0); | ||
|
||
creationCode = type(VestingSimple).creationCode; | ||
constructorArgs = abi.encode(SWETH, 30 days, 0.01e18); | ||
deployer.deployContract("VestingSimple SWETH 30 days V0.0", creationCode, constructorArgs, 0); | ||
vm.stopBroadcast(); | ||
} | ||
} |
Oops, something went wrong.