Skip to content

Commit 9a1c66e

Browse files
committed
timelocked tokens deployment script
Signed-off-by: Stefan Adolf <[email protected]>
1 parent 483a566 commit 9a1c66e

File tree

2 files changed

+31
-15
lines changed

2 files changed

+31
-15
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ forge script --private-key=$PRIVATE_KEY --rpc-url=$RPC_URL script/prod/RolloutTo
103103
// 0xTokenizer 0xNewImpl 0xNewTokenImpl
104104
cast send --rpc-url=$RPC_URL --private-key=$PRIVATE_KEY 0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e "upgradeToAndCall(address,bytes)" 0x70e0bA845a1A0F2DA3359C97E0285013525FFC49 0x84646c1f000000000000000000000000998abeb3e57409262ae5b751f60747921b33613e
105105

106+
### Timelocked Tokens
107+
108+
originally the "timelocked token" was an inline concept of the slcs. Timelock contracts weren't reusable among cs impls. This changes as of beginning of 2025. As a rather simple but not very elegant (and certainly not correct) solution we decided to "trust" external locking contracts so you can reuse them among crowdsale instances. This was needed for the VitaRNA crowdsale that's supposed to just support locks, no stakes - and hence required another crowdsale instance. During this upgrade we decided to externalize the timelock token template so upcoming instances can be verified on chain.
109+
110+
---
111+
106112
## Prerequisites
107113

108114
To work with this repository you have to install Foundry (<https://getfoundry.sh>). Run the following command in your terminal, then follow the onscreen instructions (macOS and Linux):

script/prod/RolloutV25Sale.sol

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,21 @@ import { StakedLockingCrowdSale } from "../../src/crowdsale/StakedLockingCrowdSa
1010
import { LockingCrowdSale } from "../../src/crowdsale/LockingCrowdSale.sol";
1111
import { TimelockedToken } from "../../src/TimelockedToken.sol";
1212
import { TokenVesting } from "@moleculeprotocol/token-vesting/TokenVesting.sol";
13+
import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
1314

1415
TimelockedToken constant timelockedTokenImplementation = TimelockedToken(0xF8F79c1E02387b0Fc9DE0945cD9A2c06F127D851);
15-
address constant moleculeDevMultisig = 0x9d5a6ae551f1117946FF6e0e86ef9A1B20C90Cb0;
1616

1717
//mainnet 0xCfA0F84660fB33bFd07C369E5491Ab02C449f71B;
18+
address constant moleculeDevMultisig = 0x9d5a6ae551f1117946FF6e0e86ef9A1B20C90Cb0;
1819

19-
contract RolloutV25Sale is Script {
20+
contract DeployTimelockedTokenTemplate is Script {
2021
function run() public {
21-
22-
TokenVesting vesting = TokenVesting(0x8f80d1183CD983B01B0C9AC6777cC732Ec9800de); //Moldao
23-
2422
vm.startBroadcast();
25-
StakedLockingCrowdSale stakedLockingCrowdSale = new StakedLockingCrowdSale(timelockedTokenImplementation);
26-
vesting.grantRole(vesting.ROLE_CREATE_SCHEDULE(), address(stakedLockingCrowdSale));
27-
//stakedLockingCrowdSale.trustLockingContract(IERC20());
28-
stakedLockingCrowdSale.trustVestingContract(vesting);
29-
// stakedLockingCrowdSale.transferOwnership(moleculeDevMultisig);
23+
TimelockedToken impl = new TimelockedToken();
24+
impl.initialize(IERC20Metadata(address(0x0)));
3025
vm.stopBroadcast();
3126

32-
console.log("STAKED_LOCKING_CROWDSALE_ADDRESS=%s", address(stakedLockingCrowdSale));
33-
console.log("timelocked token implementation=%s", address(timelockedTokenImplementation));
34-
// 0x7c36c64DA1c3a2065074caa9C48e7648FB733aAB
35-
// vestedDaoToken.grantRole(vestedDaoToken.ROLE_CREATE_SCHEDULE(), address(stakedLockingCrowdSale));
36-
// stakedLockingCrowdSale.trustVestingContract(vestedDaoToken);
27+
console.log("timelocked token implementation=%s", address(impl));
3728
}
3829
}
3930

@@ -47,6 +38,25 @@ contract RolloutV25LockingSale is Script {
4738

4839
console.log("LOCKING_CROWDSALE_ADDRESS=%s", address(lockingCrowdsale));
4940
console.log("timelocked token implementation=%s", address(timelockedTokenImplementation));
41+
}
42+
}
43+
44+
45+
contract RolloutV25StakedSale is Script {
46+
function run() public {
47+
48+
TokenVesting vesting = TokenVesting(0x8f80d1183CD983B01B0C9AC6777cC732Ec9800de); //Moldao
49+
50+
vm.startBroadcast();
51+
StakedLockingCrowdSale stakedLockingCrowdSale = new StakedLockingCrowdSale(timelockedTokenImplementation);
52+
vesting.grantRole(vesting.ROLE_CREATE_SCHEDULE(), address(stakedLockingCrowdSale));
53+
//stakedLockingCrowdSale.trustLockingContract(IERC20());
54+
stakedLockingCrowdSale.trustVestingContract(vesting);
55+
// stakedLockingCrowdSale.transferOwnership(moleculeDevMultisig);
56+
vm.stopBroadcast();
57+
58+
console.log("STAKED_LOCKING_CROWDSALE_ADDRESS=%s", address(stakedLockingCrowdSale));
59+
console.log("timelocked token implementation=%s", address(timelockedTokenImplementation));
5060
// 0x7c36c64DA1c3a2065074caa9C48e7648FB733aAB
5161
// vestedDaoToken.grantRole(vestedDaoToken.ROLE_CREATE_SCHEDULE(), address(stakedLockingCrowdSale));
5262
// stakedLockingCrowdSale.trustVestingContract(vestedDaoToken);

0 commit comments

Comments
 (0)