diff --git a/ethereum/contracts/Ekoke.sol b/ethereum/contracts/Ekoke.sol index 16dd626..5ae2f24 100644 --- a/ethereum/contracts/Ekoke.sol +++ b/ethereum/contracts/Ekoke.sol @@ -10,28 +10,29 @@ import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; contract Ekoke is ERC20, Ownable { /// @notice The address of the reward pool contract. address public rewardPool; - /// @notice token decimals - uint8 private _decimals; /// @notice The maximum supply of the token. (8 Millions and more) uint256 public constant MAX_SUPPLY = 888_010_101_000_000; - /// @notice The maximum amount of tokens mintable by the reward pool. (7 Millions) - uint256 public constant MAX_REWARD_POOL_MINT = 700_000_000_000_000; - /// @notice The maximum amount of tokens mintable by the owner. (~1 Million) + /// @notice The maximum amount of tokens mintable by the reward pool. (66%) + uint256 public constant MAX_REWARD_POOL_MINT = 592_006_734_000_000; + /// @notice The maximum amount of tokens mintable by the owner. (33%) uint256 public constant MAX_OWNER_MINT = MAX_SUPPLY - MAX_REWARD_POOL_MINT; + /// @notice contract decimals + uint8 private DECIMALS = 8; /// @notice The amount of tokens minted by the reward pool. uint256 public rewardPoolMintedSupply = 0; /// @notice The amount of tokens minted by the owner. uint256 public ownerMintedSupply = 0; + /// @notice Event emitted when tokens are minted by the reward pool. event RewardMinted(address indexed _to, uint256 _amount); + /// @notice Event emitted when tokens are minted by the owner. event OwnerMinted(address indexed _to, uint256 _amount); constructor( address _initialOwner ) ERC20("Ekoke", "EKOKE") Ownable(_initialOwner) { - _decimals = 8; rewardPool = address(0); } @@ -44,7 +45,7 @@ contract Ekoke is ERC20, Ownable { } function decimals() public view virtual override returns (uint8) { - return _decimals; + return DECIMALS; } /// @notice Mint the provided amount of tokens to the recipient. Only the reward pool can call this function. diff --git a/src/deferred_minter/src/app/ethereum/reward_pool.rs b/src/deferred_minter/src/app/ethereum/reward_pool.rs index 92ea896..8a08734 100644 --- a/src/deferred_minter/src/app/ethereum/reward_pool.rs +++ b/src/deferred_minter/src/app/ethereum/reward_pool.rs @@ -19,7 +19,7 @@ impl RewardPool { /// Get the available amount of reward tokens in the reward pool pub async fn available_rewards(&self, client: &EvmRpcClient) -> DeferredMinterResult { if cfg!(test) { - return Ok(700_000_000_000_000); + return Ok(592_006_734_000_000); } let call = abi::RewardPoolCalls::AvailableReward(AvailableRewardCall).encode(); @@ -53,6 +53,6 @@ mod test { .await .unwrap(); - assert_eq!(reward_pool, 700000000000000); + assert_eq!(reward_pool, 592006734000000); } } diff --git a/src/deferred_minter/src/app/reward.rs b/src/deferred_minter/src/app/reward.rs index e7e3b43..0e9b2ac 100644 --- a/src/deferred_minter/src/app/reward.rs +++ b/src/deferred_minter/src/app/reward.rs @@ -191,14 +191,14 @@ mod test { use super::*; - const DEFAULT_REMAINING_SUPPLY: u128 = 700_000_000_000_000; + const DEFAULT_REMAINING_SUPPLY: u128 = 592_006_734_000_000; #[tokio::test] async fn test_should_get_reward_if_pool_doesnt_exist() { assert_eq!( Reward::get_contract_reward(4_000, DEFAULT_REMAINING_SUPPLY, BASE_TOKEN_PRICE as u64) .unwrap(), - 2_939_999_999, // 29 ekoke + 2486428282, // 29 ekoke ); assert_eq!(CPM.with_borrow(|cpm| *cpm.get()), 1); @@ -207,7 +207,7 @@ mod test { // next reward should be less assert_eq!( Reward::get_contract_reward(4_000, remaining_supply, BASE_TOKEN_PRICE as u64).unwrap(), - 2939876519, + 2486304802, ); assert_eq!(CPM.with_borrow(|cpm| *cpm.get()), 2); } @@ -216,7 +216,7 @@ mod test { async fn test_should_get_less_value_if_token_price_is_lower() { assert_eq!( Reward::get_contract_reward(4_000, DEFAULT_REMAINING_SUPPLY, 1).unwrap(), - 2_940_000_000 / 100, // 0.29 ekoke + 24864283, // 0.29 ekoke ); assert_eq!(CPM.with_borrow(|cpm| *cpm.get()), 1); }