-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testnet: scripts and config to test the burn on sepolia
* mock ERC20 for stETH * mock rETH * deployment scripts for AHV2, ExecutorV3 and the burner contract * update subgraph and webapp config to point to the latest deployment
- Loading branch information
1 parent
7da6435
commit d5b76f5
Showing
13 changed files
with
262 additions
and
24 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,20 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
pragma solidity ^0.8.19; | ||
|
||
import { Ownable } from '@openzeppelin/contracts/access/Ownable.sol'; | ||
import { ERC20 } from '@openzeppelin/contracts/token/ERC20/ERC20.sol'; | ||
|
||
contract ERC20Testnet is ERC20, Ownable { | ||
constructor( | ||
address owner_, | ||
string memory name_, | ||
string memory symbol_ | ||
) ERC20(name_, symbol_) { | ||
_transferOwnership(owner_); | ||
} | ||
|
||
function mint(address to, uint256 amount) external onlyOwner { | ||
_mint(to, amount); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
packages/nouns-contracts/contracts/test/RocketETHTestnet.sol
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,26 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
pragma solidity ^0.8.19; | ||
|
||
import { Ownable } from '@openzeppelin/contracts/access/Ownable.sol'; | ||
import { ERC20 } from '@openzeppelin/contracts/token/ERC20/ERC20.sol'; | ||
|
||
contract RocketETHTestnet is ERC20, Ownable { | ||
uint256 rate; | ||
|
||
constructor(address owner_) ERC20('Rocket ETH Testnet', 'rETH') { | ||
_transferOwnership(owner_); | ||
} | ||
|
||
function mint(address to, uint256 amount) external onlyOwner { | ||
_mint(to, amount); | ||
} | ||
|
||
function setRate(uint256 rate_) public onlyOwner { | ||
rate = rate_; | ||
} | ||
|
||
function getEthValue(uint256 _rethAmount) external view returns (uint256) { | ||
return _rethAmount * rate; | ||
} | ||
} |
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
15 changes: 15 additions & 0 deletions
15
packages/nouns-contracts/script/DeployAuctionHouseV2Sepolia.s.sol
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,15 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.19; | ||
|
||
import 'forge-std/Script.sol'; | ||
import { NounsAuctionHouse } from '../contracts/NounsAuctionHouse.sol'; | ||
import { NounsAuctionHouseV2 } from '../contracts/NounsAuctionHouseV2.sol'; | ||
import { NounsAuctionHousePreV2Migration } from '../contracts/NounsAuctionHousePreV2Migration.sol'; | ||
|
||
import { DeployAuctionHouseV2Base } from './DeployAuctionHouseV2Base.s.sol'; | ||
|
||
contract DeployAuctionHouseV2Sepolia is DeployAuctionHouseV2Base { | ||
address constant AUCTION_HOUSE_SEPOLIA = 0x45ebbdb0E66aC2a8339D98aDB6934C89f166A754; | ||
|
||
constructor() DeployAuctionHouseV2Base(AUCTION_HOUSE_SEPOLIA) {} | ||
} |
65 changes: 65 additions & 0 deletions
65
...ontracts/script/executorV3AndExcessETHBurner/DeployExecutorV3AndExcessETHBurnerBase.s.sol
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,65 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.19; | ||
|
||
import 'forge-std/Script.sol'; | ||
import { NounsDAOExecutorV3 } from '../../contracts/governance/NounsDAOExecutorV3.sol'; | ||
import { ExcessETHBurner, INounsDAOV3 } from '../../contracts/governance/ExcessETHBurner.sol'; | ||
import { NounsDAOLogicV3 } from '../../contracts/governance/NounsDAOLogicV3.sol'; | ||
import { INounsAuctionHouseV2 } from '../../contracts/interfaces/INounsAuctionHouseV2.sol'; | ||
import { IERC20 } from '@openzeppelin/contracts/interfaces/IERC20.sol'; | ||
|
||
abstract contract DeployExecutorV3AndExcessETHBurnerBase is Script { | ||
address public immutable executorProxy; | ||
NounsDAOLogicV3 public immutable daoProxy; | ||
INounsAuctionHouseV2 public immutable auction; | ||
IERC20 wETH; | ||
IERC20 stETH; | ||
IERC20 rETH; | ||
uint128 burnStartNounID; | ||
uint128 minNewNounsBetweenBurns; | ||
uint16 numberOfPastAuctionsForMeanPrice; | ||
|
||
constructor( | ||
address payable executorProxy_, | ||
address wETH_, | ||
address stETH_, | ||
address rETH_, | ||
uint128 burnStartNounID_, | ||
uint128 minNewNounsBetweenBurns_, | ||
uint16 numberOfPastAuctionsForMeanPrice_ | ||
) { | ||
executorProxy = executorProxy_; | ||
|
||
daoProxy = NounsDAOLogicV3(payable(NounsDAOExecutorV3(executorProxy_).admin())); | ||
auction = INounsAuctionHouseV2(daoProxy.nouns().minter()); | ||
|
||
wETH = IERC20(wETH_); | ||
stETH = IERC20(stETH_); | ||
rETH = IERC20(rETH_); | ||
|
||
burnStartNounID = burnStartNounID_; | ||
minNewNounsBetweenBurns = minNewNounsBetweenBurns_; | ||
numberOfPastAuctionsForMeanPrice = numberOfPastAuctionsForMeanPrice_; | ||
} | ||
|
||
function run() public returns (NounsDAOExecutorV3 executorV3, ExcessETHBurner burner) { | ||
uint256 deployerKey = vm.envUint('DEPLOYER_PRIVATE_KEY'); | ||
|
||
vm.startBroadcast(deployerKey); | ||
|
||
executorV3 = new NounsDAOExecutorV3(); | ||
burner = new ExcessETHBurner( | ||
executorProxy, | ||
INounsDAOV3(address(daoProxy)), | ||
auction, | ||
wETH, | ||
stETH, | ||
rETH, | ||
burnStartNounID, | ||
minNewNounsBetweenBurns, | ||
numberOfPastAuctionsForMeanPrice | ||
); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...racts/script/executorV3AndExcessETHBurner/DeployExecutorV3AndExcessETHBurnerSepolia.s.sol
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,33 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.19; | ||
|
||
import 'forge-std/Script.sol'; | ||
import { DeployExecutorV3AndExcessETHBurnerBase } from './DeployExecutorV3AndExcessETHBurnerBase.s.sol'; | ||
import { NounsDAOExecutorV3 } from '../../contracts/governance/NounsDAOExecutorV3.sol'; | ||
import { ExcessETHBurner, INounsDAOV3 } from '../../contracts/governance/ExcessETHBurner.sol'; | ||
import { NounsDAOLogicV3 } from '../../contracts/governance/NounsDAOLogicV3.sol'; | ||
import { INounsAuctionHouseV2 } from '../../contracts/interfaces/INounsAuctionHouseV2.sol'; | ||
import { IERC20 } from '@openzeppelin/contracts/interfaces/IERC20.sol'; | ||
|
||
contract DeployExecutorV3AndExcessETHBurnerSepolia is DeployExecutorV3AndExcessETHBurnerBase { | ||
address payable constant EXECUTOR_PROXY = payable(0x6c2dD53b8DbDD3af1209DeB9dA87D487EaE8E638); | ||
address constant WETH = 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14; | ||
address constant STETH = 0x7f96dAEF4A54F6A52613d6272560C2BD25e913B8; | ||
address constant RETH = 0xf07dafCC49a9F5E1E73Df6bD6616d0a5bA19e502; | ||
|
||
uint128 BURN_START_NOUN_ID = 10; | ||
uint128 MIN_NOUNS_BETWEEN_BURNS = 10; | ||
uint16 MEAN_AUCTION_COUNT = 10; | ||
|
||
constructor() | ||
DeployExecutorV3AndExcessETHBurnerBase( | ||
EXECUTOR_PROXY, | ||
WETH, | ||
STETH, | ||
RETH, | ||
BURN_START_NOUN_ID, | ||
MIN_NOUNS_BETWEEN_BURNS, | ||
MEAN_AUCTION_COUNT | ||
) | ||
{} | ||
} |
24 changes: 24 additions & 0 deletions
24
packages/nouns-contracts/script/executorV3AndExcessETHBurner/DeployTestnetTokens.s.sol
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,24 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.19; | ||
|
||
import 'forge-std/Script.sol'; | ||
import { RocketETHTestnet } from '../../contracts/test/RocketETHTestnet.sol'; | ||
import { ERC20Testnet } from '../../contracts/test/ERC20Testnet.sol'; | ||
|
||
contract DeployTestnetTokens is Script { | ||
function run() public { | ||
uint256 deployerKey = vm.envUint('DEPLOYER_PRIVATE_KEY'); | ||
address owner = vm.addr(deployerKey); | ||
|
||
vm.startBroadcast(deployerKey); | ||
|
||
ERC20Testnet stETH = new ERC20Testnet(owner, 'Test Staked Ether', 'stETH'); | ||
RocketETHTestnet rETH = new RocketETHTestnet(owner); | ||
|
||
console.log('Owner: %s', owner); | ||
console.log('stETH: %s', address(stETH)); | ||
console.log('rETH: %s', address(rETH)); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...es/nouns-contracts/script/executorV3AndExcessETHBurner/ProposeExecutorV3UpgradeBase.s.sol
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,35 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.15; | ||
|
||
import 'forge-std/Script.sol'; | ||
import { NounsDAOLogicV3 } from '../../contracts/governance/NounsDAOLogicV3.sol'; | ||
|
||
abstract contract ProposeExecutorV3UpgradeBase is Script { | ||
uint256 proposerKey; | ||
string description; | ||
NounsDAOLogicV3 daoProxy; | ||
address executorProxy; | ||
address executorV3Impl; | ||
|
||
function run() public returns (uint256 proposalId) { | ||
vm.startBroadcast(proposerKey); | ||
|
||
uint8 numTxs = 1; | ||
address[] memory targets = new address[](numTxs); | ||
uint256[] memory values = new uint256[](numTxs); | ||
string[] memory signatures = new string[](numTxs); | ||
bytes[] memory calldatas = new bytes[](numTxs); | ||
|
||
// Upgrade to executor V3 | ||
uint256 i = 0; | ||
targets[i] = executorProxy; | ||
values[i] = 0; | ||
signatures[i] = 'upgradeTo(address)'; | ||
calldatas[i] = abi.encode(executorV3Impl); | ||
|
||
proposalId = daoProxy.propose(targets, values, signatures, calldatas, description); | ||
console.log('Proposed proposalId: %d', proposalId); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...nouns-contracts/script/executorV3AndExcessETHBurner/ProposeExecutorV3UpgradeMainnet.s.sol
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,21 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.15; | ||
|
||
import 'forge-std/Script.sol'; | ||
import { ProposeExecutorV3UpgradeBase } from './ProposeExecutorV3UpgradeBase.s.sol'; | ||
import { NounsDAOLogicV3 } from '../../contracts/governance/NounsDAOLogicV3.sol'; | ||
|
||
contract ProposeDAOV3UpgradeMainnet is ProposeExecutorV3UpgradeBase { | ||
NounsDAOLogicV3 public constant NOUNS_DAO_PROXY_MAINNET = | ||
NounsDAOLogicV3(payable(0x6f3E6272A167e8AcCb32072d08E0957F9c79223d)); | ||
address public constant EXECUTOR_PROXY_MAINNET = 0xb1a32FC9F9D8b2cf86C068Cae13108809547ef71; | ||
address public constant EXECUTOR_V3_IMPL = address(0); | ||
|
||
constructor() { | ||
proposerKey = vm.envUint('PROPOSER_KEY'); | ||
description = vm.readFile(vm.envString('PROPOSAL_DESCRIPTION_FILE')); | ||
daoProxy = NOUNS_DAO_PROXY_MAINNET; | ||
executorProxy = EXECUTOR_PROXY_MAINNET; | ||
executorV3Impl = EXECUTOR_V3_IMPL; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
{ | ||
"network": "sepolia", | ||
"nounsToken": { | ||
"address": "0x4C4674bb72a096855496a7204962297bd7e12b85", | ||
"startBlock": 3594636 | ||
"address": "0x2824dcE6253476cBfAB91764F5715763d6e451a3", | ||
"startBlock": 4418279 | ||
}, | ||
"nounsAuctionHouse": { | ||
"address": "0x488609b7113FCf3B761A05956300d605E8f6BcAf", | ||
"startBlock": 3594636 | ||
"address": "0x45ebbdb0E66aC2a8339D98aDB6934C89f166A754", | ||
"startBlock": 4418279 | ||
}, | ||
"nounsDAO": { | ||
"address": "0x35d2670d7C8931AACdd37C89Ddcb0638c3c44A57", | ||
"startBlock": 3594636 | ||
"address": "0xBE875f62C35124e27C3F638164049617b883B746", | ||
"startBlock": 4418279 | ||
}, | ||
"nounsDAOData": { | ||
"address": "0x9040f720AA8A693F950B9cF94764b4b06079D002", | ||
"startBlock": 3594636 | ||
"address": "0x6D1aa9B6Ee004deBE34390d8bc7602A36a4b9655", | ||
"startBlock": 4418279 | ||
} | ||
} |
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