diff --git a/.env.template b/.env.template index e016c2d..b9d3a47 100644 --- a/.env.template +++ b/.env.template @@ -72,6 +72,18 @@ RESERVE_MINT_RATE= RESERVE_TOKEN_NAME= RESERVE_TOKEN_SYMBOL= +## Name and symbol for the base token of the ghostDAO protocol +FATSO_TOKEN_NAME= +FATSO_TOKEN_SYMBOL= + +## Name and symbol for the staking token of the ghostDAO protocol +STINKY_TOKEN_NAME= +STINKY_TOKEN_SYMBOL= + +## Name and symbol for the bridging token of the ghostDAO protocol +GHOST_TOKEN_NAME= +GHOST_TOKEN_SYMBOL= + SEPOLIA_TEST_RPC_URL= SEPOLIA_TEST_API_KEY= SEPOLIA_TEST_ENDPOINT= diff --git a/src/FatsoERC20.sol b/src/FatsoERC20.sol index d642408..d3d6743 100644 --- a/src/FatsoERC20.sol +++ b/src/FatsoERC20.sol @@ -7,9 +7,9 @@ import "./interfaces/IFTSO.sol"; import "./types/GhostAccessControlled.sol"; contract Fatso is ERC20Permit, IFTSO, GhostAccessControlled { - constructor(address _authority) - ERC20("Fatso", "FTSO") - ERC20Permit("Fatso") + constructor(address _authority, string memory name, string memory symbol) + ERC20(name, symbol) + ERC20Permit(name) GhostAccessControlled(IGhostAuthority(_authority)) {} diff --git a/src/GhstERC20.sol b/src/GhstERC20.sol index 76888e4..7edfaef 100644 --- a/src/GhstERC20.sol +++ b/src/GhstERC20.sol @@ -13,7 +13,10 @@ contract Ghost is IGHST, ERC20, ERC20Permit, ERC20Votes { address public override stnk; address private _initializer; - constructor(address _stnk) ERC20("Ghost", "GHST") ERC20Permit("Ghost") { + constructor(address _stnk, string memory name, string memory symbol) + ERC20(name, symbol) + ERC20Permit(name) + { stnk = _stnk; _initializer = msg.sender; } diff --git a/src/StinkyERC20.sol b/src/StinkyERC20.sol index d086024..1d92631 100644 --- a/src/StinkyERC20.sol +++ b/src/StinkyERC20.sol @@ -27,7 +27,10 @@ contract Stinky is ISTNK, ERC20Permit { mapping(address => uint256) private _shares; mapping(address => mapping(address => uint256)) private _allowedValue; - constructor(uint256 usedIndex) ERC20("Stinky", "STNK") ERC20Permit("Stinky") { + constructor(uint256 usedIndex, string memory name, string memory symbol) + ERC20(name, symbol) + ERC20Permit(name) + { _initializer = msg.sender; _internalIndex = usedIndex; _totalSupply = INITIAL_SHARES_SUPPLY; diff --git a/test/bonding/BondDepositorty.t.sol b/test/bonding/BondDepositorty.t.sol index 8c787d8..8b39f76 100644 --- a/test/bonding/BondDepositorty.t.sol +++ b/test/bonding/BondDepositorty.t.sol @@ -16,9 +16,9 @@ contract GhostBondDepositoryTest is Test { uint256 public constant TOTAL_INITIAL_SUPPLY = 5000000000000000; uint256 public constant LARGE_APPROVAL = 100000000000000000000000000000000; uint256 public constant INITIAL_INDEX = 10819917194513808e56; - uint48 public constant EPOCH_LENGTH = 2200; - uint48 public constant EPOCH_NUMBER = 1; - uint48 public constant EPOCH_END_TIME = 1337; + uint48 public constant EPOCH_LENGTH = 2200; + uint48 public constant EPOCH_NUMBER = 1; + uint48 public constant EPOCH_END_TIME = 1337; uint256 public constant initialMint = 10000000000000000000000000; uint256 public constant initialDeposit = 1000000000000000000000000; @@ -59,9 +59,9 @@ contract GhostBondDepositoryTest is Test { vault ); reserve = new ERC20Mock("Reserve Token", "RET"); - ftso = new Fatso(address(authority)); - stnk = new Stinky(INITIAL_INDEX); - ghst = new Ghost(address(stnk)); + ftso = new Fatso(address(authority), "Fatso", "FTSO"); + stnk = new Stinky(INITIAL_INDEX, "Stinky", "STNK"); + ghst = new Ghost(address(stnk), "Ghost", "GHST"); staking = new GhostStaking( address(ftso), address(stnk), diff --git a/test/staking/Staking.t.sol b/test/staking/Staking.t.sol index 8c9fcc0..dbb8413 100644 --- a/test/staking/Staking.t.sol +++ b/test/staking/Staking.t.sol @@ -47,9 +47,9 @@ contract StakingTest is Test { policy, vault ); - ftso = new Fatso(address(authority)); - stnk = new Stinky(INITIAL_INDEX); - ghst = new Ghost(address(stnk)); + ftso = new Fatso(address(authority), "Fatso", "FTSO"); + stnk = new Stinky(INITIAL_INDEX, "Stinky", "STNK"); + ghst = new Ghost(address(stnk), "Ghost", "GHST"); staking = new GhostStaking( address(ftso), address(stnk), diff --git a/test/staking/StakingDistributor.t.sol b/test/staking/StakingDistributor.t.sol index fcca364..27f77b6 100644 --- a/test/staking/StakingDistributor.t.sol +++ b/test/staking/StakingDistributor.t.sol @@ -22,7 +22,7 @@ contract StakingDistributorTest is Test { uint48 public constant EPOCH_LENGTH = 2200; uint48 public constant EPOCH_NUMBER = 1; uint48 public constant EPOCH_END_TIME = 1337; - + uint256 public constant INITIAL_INDEX = 10819917194513808e56; uint256 public constant amount = 69 * 1e18; @@ -47,9 +47,9 @@ contract StakingDistributorTest is Test { owner ); reserve = new ERC20Mock("Reserve Token", "RET"); - ftso = new Fatso(address(authority)); - stnk = new Stinky(INITIAL_INDEX); - ghst = new Ghost(address(stnk)); + ftso = new Fatso(address(authority), "Fatso", "FTSO"); + stnk = new Stinky(INITIAL_INDEX, "Stinky", "STNK"); + ghst = new Ghost(address(stnk), "Ghost", "GHST"); staking = new GhostStaking( address(ftso), address(stnk), diff --git a/test/tokens/Ftso.t.sol b/test/tokens/Ftso.t.sol index f933871..b60eea1 100644 --- a/test/tokens/Ftso.t.sol +++ b/test/tokens/Ftso.t.sol @@ -20,6 +20,9 @@ contract FatsoTest is Test, ERC20PermitTest, ERC20AllowanceTest, ERC20TransferTe uint256 constant amount = 69; uint256 constant maxAmount = type(uint256).max; + string constant name = "Fatso Test Name"; + string constant symbol = "FTSOTST"; + function setUp() public { authority = new GhostAuthority( deployer, @@ -27,7 +30,7 @@ contract FatsoTest is Test, ERC20PermitTest, ERC20AllowanceTest, ERC20TransferTe deployer, vault ); - token = new Fatso(address(authority)); + token = new Fatso(address(authority), name, symbol); initializePermit(address(token), amount, maxAmount); initializeAllowance(alice, bob, address(token), amount, maxAmount, amount); initializeTransfer(alice, bob, address(token), amount, 0); @@ -48,8 +51,8 @@ contract FatsoTest is Test, ERC20PermitTest, ERC20AllowanceTest, ERC20TransferTe } function test_correctlyConstructsAnERC20() public view { - assertEq(token.name(), "Fatso"); - assertEq(token.symbol(), "FTSO"); + assertEq(token.name(), name); + assertEq(token.symbol(), symbol); assertEq(token.decimals(), 9); } diff --git a/test/tokens/Ghst.t.sol b/test/tokens/Ghst.t.sol index 1295dcc..4a5642b 100644 --- a/test/tokens/Ghst.t.sol +++ b/test/tokens/Ghst.t.sol @@ -28,6 +28,9 @@ contract GhostTest is uint256 constant amount = 69; uint256 constant maxAmount = type(uint256).max; + string constant name = "Ghost Test Name"; + string constant symbol = "GHSTTST"; + Stinky stnk; Ghost ghst; GhostAuthority public authority; @@ -41,8 +44,8 @@ contract GhostTest is initializer, initializer ); - stnk = new Stinky(INITIAL_INDEX); - ghst = new Ghost(address(stnk)); + stnk = new Stinky(INITIAL_INDEX, "Stinky", "STNK"); + ghst = new Ghost(address(stnk), name, symbol); staking = new GhostStaking( address(0), address(stnk), @@ -63,8 +66,8 @@ contract GhostTest is } function test_isConstructedCorrectly() public view { - assertEq(ghst.name(), "Ghost"); - assertEq(ghst.symbol(), "GHST"); + assertEq(ghst.name(), name); + assertEq(ghst.symbol(), symbol); assertEq(ghst.decimals(), 18); assertEq(ghst.staking(), address(staking)); assertEq(ghst.stnk(), address(stnk)); diff --git a/test/tokens/Stnk.t.sol b/test/tokens/Stnk.t.sol index bde9e45..08a0e8c 100644 --- a/test/tokens/Stnk.t.sol +++ b/test/tokens/Stnk.t.sol @@ -35,6 +35,9 @@ contract StinkyTest is Test, ERC20PermitTest, ERC20AllowanceTest, ERC20TransferT uint256 constant amount = 69; uint256 constant maxAmount = type(uint256).max; + string constant name = "Stinky Test Name"; + string constant symbol = "STNKTST"; + event Transfer(address indexed from, address indexed to, uint256 value); event LogStakingContractUpdated(address stakingContract); @@ -46,9 +49,9 @@ contract StinkyTest is Test, ERC20PermitTest, ERC20AllowanceTest, ERC20TransferT initializer, initializer ); - ftso = new Fatso(address(authority)); - stnk = new Stinky(INITIAL_INDEX); - ghst = new Ghost(address(stnk)); + ftso = new Fatso(address(authority), "Fatso", "FTSO"); + stnk = new Stinky(INITIAL_INDEX, name, symbol); + ghst = new Ghost(address(stnk), "Ghost", "GHST"); staking = new GhostStaking( address(ftso), address(stnk), @@ -67,8 +70,8 @@ contract StinkyTest is Test, ERC20PermitTest, ERC20AllowanceTest, ERC20TransferT } function test_isConstructedCorrectly() public view { - assertEq(stnk.name(), "Stinky"); - assertEq(stnk.symbol(), "STNK"); + assertEq(stnk.name(), name); + assertEq(stnk.symbol(), symbol); assertEq(stnk.decimals(), 9); assertEq(stnk.totalSupply(), TOTAL_INITIAL_SUPPLY); assertEq(stnk.index(), INITIAL_INDEX / (TOTAL_SHARES / INITIAL_SHARES_SUPPLY)); @@ -246,7 +249,7 @@ contract StinkyTest is Test, ERC20PermitTest, ERC20AllowanceTest, ERC20TransferT uint256 prevIndex = stnk.index(); _mintTokens(alice, amount); assertEq(stnk.balanceOf(alice), amount); - + vm.prank(address(staking)); stnk.rebase(0, epoch); diff --git a/test/treasury/Treasury.t.sol b/test/treasury/Treasury.t.sol index 2d4dbe5..79ecf3e 100644 --- a/test/treasury/Treasury.t.sol +++ b/test/treasury/Treasury.t.sol @@ -35,7 +35,7 @@ contract GhostTreasuryTest is Test { ); reserve = new ERC20Mock("Reserve Token", "RET"); liquidity = new ERC20Mock("Liquidity Token", "LDT"); - ftso = new Fatso(address(authority)); + ftso = new Fatso(address(authority), "Fatso", "FTSO"); treasury = new GhostTreasury(address(ftso), 69, address(authority)); calculator = new GhostBondingCalculator(address(ftso)); vm.stopPrank();