Skip to content

Commit

Permalink
Transfers ownership of L1LiskToken contract to configured address aft…
Browse files Browse the repository at this point in the history
…er deployment
  • Loading branch information
has5aan committed Dec 22, 2023
1 parent 6cdef1a commit 66b1498
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion script/L1LiskToken.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ contract L1LiskTokenScript is Script {
// Deployer's private key. Owner of the L1 Lisk token. PRIVATE_KEY is set in .env file.
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");

// Address, the ownership of L1 Lisk token contract is transferred to after deployment.
address ownerAddress = vm.envAddress("OWNER_ADDRESS");
console2.log("Simulation: Deploying L1 Lisk token...");

// deploy L1LiskToken contract
vm.startBroadcast(deployerPrivateKey);
L1LiskToken l1LiskToken = new L1LiskToken();
l1LiskToken.transferOwnership(ownerAddress);
vm.stopBroadcast();

assert(address(l1LiskToken) != address(0));
Expand All @@ -33,8 +36,11 @@ contract L1LiskTokenScript is Script {
assert(l1LiskToken.decimals() == 18);
assert(l1LiskToken.totalSupply() == 300000000 * 10 ** 18);
assert(l1LiskToken.balanceOf(vm.addr(deployerPrivateKey)) == 300000000 * 10 ** 18);
assert(l1LiskToken.hasRole(l1LiskToken.DEFAULT_ADMIN_ROLE(), vm.addr(deployerPrivateKey)) == true);
assert(l1LiskToken.hasRole(l1LiskToken.DEFAULT_ADMIN_ROLE(), vm.addr(deployerPrivateKey)) == false);
assert(l1LiskToken.hasRole(l1LiskToken.BURNER_ROLE(), vm.addr(deployerPrivateKey)) == false);
assert(l1LiskToken.hasRole(l1LiskToken.DEFAULT_ADMIN_ROLE(), ownerAddress) == true);
assert(l1LiskToken.hasRole(l1LiskToken.BURNER_ROLE(), ownerAddress) == false);
assert(l1LiskToken.balanceOf(ownerAddress) == 0);

console2.log("Simulation: L1 Lisk token successfully deployed!");
console2.log("Simulation: L1 Lisk token address: %s", address(l1LiskToken));
Expand Down

0 comments on commit 66b1498

Please sign in to comment.