Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAO address for Claim contract is called after TimelockController is deployed #77

Merged
merged 2 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: PR CI

on:
pull_request:
branches: [ main, 'feature/lisk-dao-staking' ]
branches: [ main ]

permissions:
contents: read
Expand Down
12 changes: 1 addition & 11 deletions script/L2Claim.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ contract L2ClaimScript is Script {

console2.log("Deploying L2 Claim contract...");

// DAO Address, will be used to receive unclaimed LSK after claim period
address daoAddress = vm.envAddress("DAO_ADDRESS");
console2.log("DAO address: %s", daoAddress);

// owner Address, the ownership of L2Claim Proxy Contract is transferred to after deployment
address ownerAddress = vm.envAddress("L2_CLAIM_OWNER_ADDRESS");
console2.log("L2 Claim contract owner address: %s (after ownership will be accepted)", ownerAddress);
Expand Down Expand Up @@ -72,12 +68,7 @@ contract L2ClaimScript is Script {
L2Claim l2Claim = L2Claim(address(l2ClaimProxy));
assert(address(l2Claim.l2LiskToken()) == l2AddressesConfig.L2LiskToken);
assert(l2Claim.merkleRoot() == merkleRoot.merkleRoot);

// assign DAO Address
vm.startBroadcast(deployerPrivateKey);
l2Claim.setDAOAddress(daoAddress);
vm.stopBroadcast();
assert(l2Claim.daoAddress() == daoAddress);
assert(l2Claim.daoAddress() == address(0));

// transfer ownership of L2Claim Proxy; because of using Ownable2StepUpgradeable contract, new owner has to
// accept ownership
Expand All @@ -89,7 +80,6 @@ contract L2ClaimScript is Script {
console2.log("L2 Claim contract successfully deployed!");
console2.log("L2 Claim (Implementation) address: %s", address(l2ClaimImplementation));
console2.log("L2 Claim (Proxy) address: %s", address(l2Claim));
console2.log("DAO Address of L2 Claim (Proxy) address: %s", l2Claim.daoAddress());
console2.log("Owner of L2 Claim (Proxy) address: %s (after ownership will be accepted)", ownerAddress);

// write L2ClaimContract address to l2addresses.json
Expand Down
20 changes: 19 additions & 1 deletion script/L2Governor.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ import { Script, console2 } from "forge-std/Script.sol";
import { L2Governor } from "src/L2/L2Governor.sol";
import "script/Utils.sol";

/// @title IL2Claim
/// @notice Interface for L2 Claim contract. Used to set DAO address.
interface IL2Claim {
function setDAOAddress(address daoAddress) external;
function daoAddress() external view returns (address);
}

/// @title IL2Staking
/// @notice Interface for L2 Staking contract. Used to initialize Staking contract.
interface IL2Staking {
Expand Down Expand Up @@ -37,8 +44,13 @@ contract L2GovernorScript is Script {

console2.log("Deploying L2 TimelockController and Governor contracts...");

// get L2Staking contract address
// get L2Claim contract address
Utils.L2AddressesConfig memory l2AddressesConfig = utils.readL2AddressesFile();
assert(l2AddressesConfig.L2ClaimContract != address(0));
console2.log("L2 Claim address: %s", l2AddressesConfig.L2ClaimContract);
IL2Claim l2Claim = IL2Claim(l2AddressesConfig.L2ClaimContract);

// get L2Staking contract address
assert(l2AddressesConfig.L2Staking != address(0));
console2.log("L2 Staking address: %s", l2AddressesConfig.L2Staking);
IL2Staking stakingContract = IL2Staking(l2AddressesConfig.L2Staking);
Expand Down Expand Up @@ -103,6 +115,12 @@ contract L2GovernorScript is Script {
vm.stopBroadcast();
assert(stakingContract.daoTreasury() == address(timelock));

// set DAO address in L2Claim contract
vm.startBroadcast(deployerPrivateKey);
l2Claim.setDAOAddress(address(timelock));
AndreasKendziorra marked this conversation as resolved.
Show resolved Hide resolved
vm.stopBroadcast();
assert(l2Claim.daoAddress() == address(timelock));

// grant the proposer role to the Governor contract
vm.startBroadcast(deployerPrivateKey);
timelock.grantRole(timelock.PROPOSER_ROLE(), address(l2Governor));
Expand Down
Loading