|
| 1 | +// SPDX-License-Identifier: UNLICENSED |
| 2 | +pragma solidity ^0.8.13; |
| 3 | + |
| 4 | +import { Distribution, EnsoToken } from "../src/EnsoToken.sol"; |
| 5 | +import { Script } from "forge-std/Script.sol"; |
| 6 | +import { ERC1967Proxy } from "openzeppelin-contracts/proxy/ERC1967/ERC1967Proxy.sol"; |
| 7 | + |
| 8 | +contract TokenDeployer is Script { |
| 9 | + address public OWNER = 0x0676675F4fddC2f572cf0CdDaAf0a6b31841CDaC; // TODO |
| 10 | + address public COINLIST = 0x6969696969696969696969696969696969696969; // TODO |
| 11 | + |
| 12 | + uint256 WEI = 10 ** 18; |
| 13 | + uint256 TOTAL_SUPPLY = 100_000_000 * WEI; |
| 14 | + uint256 BASIS_POINTS = 10_000; |
| 15 | + uint256 COINLIST_SHARE = (TOTAL_SUPPLY * 440) / BASIS_POINTS; |
| 16 | + uint256 OWNER_SHARE = TOTAL_SUPPLY - COINLIST_SHARE; |
| 17 | + |
| 18 | + function deploy() public returns (ERC1967Proxy token, EnsoToken implementation) { |
| 19 | + implementation = new EnsoToken(); |
| 20 | + Distribution[] memory nullDistribution = new Distribution[](0); |
| 21 | + implementation.initialize("", "", address(implementation), nullDistribution); |
| 22 | + |
| 23 | + string memory name = "Enso"; |
| 24 | + string memory symbol = "ENSO"; |
| 25 | + Distribution[] memory distribution = new Distribution[](2); |
| 26 | + distribution[0] = Distribution(OWNER, OWNER_SHARE); |
| 27 | + distribution[1] = Distribution(COINLIST, COINLIST_SHARE); |
| 28 | + bytes memory initializationCall = |
| 29 | + abi.encodeWithSelector(EnsoToken.initialize.selector, name, symbol, OWNER, distribution); |
| 30 | + token = new ERC1967Proxy(address(implementation), initializationCall); |
| 31 | + } |
| 32 | + |
| 33 | + function run() public returns (ERC1967Proxy token, EnsoToken implementation) { |
| 34 | + vm.startBroadcast(); |
| 35 | + |
| 36 | + (token, implementation) = deploy(); |
| 37 | + |
| 38 | + vm.stopBroadcast(); |
| 39 | + } |
| 40 | +} |
0 commit comments