@@ -10,7 +10,7 @@ import {SpendVerifier} from "../src/SpendVerifier.sol";
1010import {IVerifier} from "../src/interfaces/IVerifier.sol " ;
1111import {IRewardPool} from "../src/interfaces/IRewardPool.sol " ;
1212import {IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol " ;
13- import {Distributor} from "../src/distributors/Distributor.sol " ;
13+ import {Distributor, newVested } from "../src/distributors/Distributor.sol " ;
1414import {StaticDistributor} from "../src/distributors/StaticDistributor.sol " ;
1515import {DynamicDistributor} from "../src/distributors/DynamicDistributor.sol " ;
1616
@@ -23,109 +23,63 @@ contract BETHScript is Script {
2323
2424 function setUp () public {}
2525
26- function newNonVested (uint256 id , address owner , uint256 amount ) internal pure returns (Distributor.Share memory ) {
27- return Distributor.Share ({
28- id: id, owner: owner, tge: amount, startTime: 0 , initialAmount: 0 , amountPerSecond: 0 , totalCap: amount
29- });
30- }
31-
32- function newVested (
33- uint256 id ,
34- address owner ,
35- uint256 tgeBips ,
36- uint256 amount ,
37- uint256 blockTimestamp ,
38- uint256 cliffPeriodInMonths ,
39- uint256 vestingInMonths
40- ) internal pure returns (Distributor.Share memory ) {
41- require (tgeBips <= 10000 , "TGE should be in basis points " );
42- require (cliffPeriodInMonths <= vestingInMonths, "Cliff period incorrect " );
43- uint256 startTime = blockTimestamp + (cliffPeriodInMonths * 4 weeks);
44- uint256 tgeAmount = amount * tgeBips / 10000 ;
45- uint256 amountAfterTge = amount - tgeAmount;
46- uint256 initialAmount = amountAfterTge * cliffPeriodInMonths / vestingInMonths;
47- uint256 amountPerSecond = (amountAfterTge - initialAmount) / ((vestingInMonths - cliffPeriodInMonths) * 30 days);
48- return Distributor.Share ({
49- id: id,
50- owner: owner,
51- tge: tgeAmount,
52- startTime: startTime,
53- initialAmount: initialAmount,
54- amountPerSecond: amountPerSecond,
55- totalCap: amount
56- });
57- }
58-
5926 function ofPremine (uint256 bipsA , uint256 bipsB ) internal pure returns (uint256 ) {
6027 return PREMINE * bipsA * bipsB / 100_000_000 ;
6128 }
6229
6330 function run () public {
6431 vm.startBroadcast ();
6532
66- uint256 startingTimestamp = block . timestamp ;
33+ uint256 startingTimestamp = 1771855200 ; // 23 Feb 2PM UTC
6734
6835 address bethMainnet = 0x5624344235607940d4d4EE76Bf8817d403EB9Cf8 ;
6936 address eip7503DotEth = 0x8DC77b145d7009752D6947B3CF6D983caFA1C0Bb ;
7037 address keyvankDotEth = 0x372abB165e3283C4E71ce68eFBA2934FEA5bFF45 ;
7138
72- uint256 numStaticShares = 7 ;
39+ uint256 numStaticShares = 9 ;
7340 Distributor.Share[] memory staticShares = new Distributor.Share [](numStaticShares);
7441
75- staticShares[ 0 ] = newNonVested ( 0 , eip7503DotEth, ofPremine (4000 , 10000 )); // 40% LP/ICO
42+ uint256 lpIcoTotal = ofPremine (4000 , 10000 );
7643
7744 // Team member #1
78- staticShares[1 ] = newVested (1 , keyvankDotEth, 0 , ofPremine (2400 , 8000 ), block . timestamp , 6 , 36 );
45+ staticShares[0 ] = newVested (1 , keyvankDotEth, 0 , ofPremine (2400 , 9000 ), startingTimestamp , 6 , 36 );
7946 // Team member #2
80- staticShares[2 ] = newVested (2 , keyvankDotEth, 0 , ofPremine (2400 , 1000 ), block .timestamp , 6 , 36 );
81- // Team member #2
82- staticShares[3 ] = newVested (3 , keyvankDotEth, 0 , ofPremine (2400 , 1000 ), block .timestamp , 6 , 36 );
47+ staticShares[1 ] = newVested (
48+ 2 , address (0xBF44aa57e71a9dBa931058064438876AC7841bfa ), 0 , ofPremine (2400 , 425 ), startingTimestamp, 6 , 36
49+ );
50+ // Team member #3
51+ staticShares[2 ] = newVested (3 , eip7503DotEth, 0 , ofPremine (2400 , 300 ), startingTimestamp, 6 , 36 );
52+ // Team member #4
53+ staticShares[3 ] = newVested (
54+ 4 , address (0x82C11504D17E26653214741f93e8400F15f88B13 ), 0 , ofPremine (2400 , 200 ), startingTimestamp, 6 , 36
55+ );
56+ // Team member #5
57+ staticShares[4 ] = newVested (5 , eip7503DotEth, 0 , ofPremine (2400 , 50 ), startingTimestamp, 6 , 36 );
58+ // Team member #6
59+ staticShares[5 ] = newVested (6 , eip7503DotEth, 0 , ofPremine (2400 , 25 ), startingTimestamp, 6 , 36 );
8360
8461 // Advisors
85- staticShares[4 ] = newVested (4 , eip7503DotEth, 0 , ofPremine (100 , 10000 ), block . timestamp , 6 , 36 );
62+ staticShares[6 ] = newVested (7 , eip7503DotEth, 0 , ofPremine (100 , 10000 ), startingTimestamp , 6 , 36 );
8663
8764 // Private investor
88- staticShares[5 ] = newVested (5 , eip7503DotEth, 0 , ofPremine (800 , 10000 ), block .timestamp , 6 , 36 );
65+ staticShares[7 ] = newVested (
66+ 8 , address (0x3693c57508606cC7f26b7Db3827a8eCebC628c66 ), 0 , ofPremine (800 , 10000 ), startingTimestamp, 6 , 36
67+ );
8968
9069 // Foundation treasury
91- staticShares[6 ] = newVested (6 , eip7503DotEth, 50 , ofPremine (1200 , 10000 ), block . timestamp , 3 , 36 );
70+ staticShares[8 ] = newVested (9 , eip7503DotEth, 500 , ofPremine (1200 , 10000 ), startingTimestamp , 3 , 36 );
9271
9372 uint256 staticsPremine = 0 ;
9473 for (uint256 i = 0 ; i < numStaticShares; i++ ) {
9574 staticsPremine += staticShares[i].totalCap;
9675 }
97- uint256 dynamicsPremine = PREMINE - staticsPremine;
76+ uint256 dynamicsPremine = PREMINE - staticsPremine - lpIcoTotal ;
9877
9978 require (877751 ether <= dynamicsPremine && dynamicsPremine <= 877752 ether, "Dynamics premine not in range! " );
10079
101- beth = BETH (bethMainnet);
102-
103- require (staticsPremine + dynamicsPremine == PREMINE, "Invalid premine! " );
104- worm = new WORM (IERC20 (beth), msg .sender , staticsPremine + dynamicsPremine, startingTimestamp);
105- require (worm.balanceOf (msg .sender ) == PREMINE, "Invalid WORM amount minted for deployer! " );
106-
107- staking = new Staking (IERC20 (worm), IERC20 (beth), 7 days, startingTimestamp);
108- beth.initRewardPool (IRewardPool (staking));
109-
11080 StaticDistributor staticDist = new StaticDistributor (IERC20 (worm), staticShares);
111- worm.transfer (address (staticDist), staticsPremine);
112- require (worm.balanceOf (address (staticDist)) == staticsPremine, "Invalid WORM balance for static distributor! " );
113- require (
114- worm.balanceOf (msg .sender ) == PREMINE - staticsPremine,
115- "Invalid WORM balance after transfer to static distributor! "
116- );
117-
11881 DynamicDistributor dynamicDist =
119- new DynamicDistributor (IERC20 (worm), block .timestamp + (3 * 30 days), address (0xa11ce ));
120- worm.transfer (address (dynamicDist), dynamicsPremine);
121- require (worm.balanceOf (address (dynamicDist)) == dynamicsPremine, "Invalid WORM balance for static distributor! " );
122- require (worm.balanceOf (msg .sender ) == 0 , "Invalid WORM balance after transfer to dynamic distributor! " );
123-
124- require (worm.totalSupply () == PREMINE, "Invalid WORM total supply! " );
125-
126- console.log ("BETH " , address (beth));
127- console.log ("WORM " , address (worm));
128- console.log ("Staking " , address (staking));
82+ new DynamicDistributor (IERC20 (worm), startingTimestamp + (3 * 30 days), address (0xa11ce ));
12983
13084 vm.stopBroadcast ();
13185 }
0 commit comments