Skip to content

Commit

Permalink
removed PREFIX_TOKEN_DAILY_MINT_AMOUNT
Browse files Browse the repository at this point in the history
  • Loading branch information
ahramy committed Oct 11, 2024
1 parent 7ac3d4c commit 855defe
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions contracts/test/mocks/MockGateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ contract MockGateway is IAxelarGatewayWithToken {
bytes32 internal constant PREFIX_TOKEN_TYPE = keccak256('token-type');
bytes32 internal constant PREFIX_CONTRACT_CALL_APPROVED = keccak256('contract-call-approved');
bytes32 internal constant PREFIX_CONTRACT_CALL_APPROVED_WITH_MINT = keccak256('contract-call-approved-with-mint');
bytes32 internal constant PREFIX_TOKEN_DAILY_MINT_AMOUNT = keccak256('token-daily-mint-amount');

mapping(bytes32 => bool) public bools;
mapping(bytes32 => address) public addresses;
Expand Down Expand Up @@ -153,10 +152,6 @@ contract MockGateway is IAxelarGatewayWithToken {
|* Getters *|
\***********/

function tokenMintAmount(string memory symbol) public view returns (uint256) {
return uints[_getTokenMintAmountKey(symbol, block.timestamp / 6 hours)];
}

function tokenAddresses(string memory symbol) public view returns (address) {
return addresses[_getTokenAddressKey(symbol)];
}
Expand Down Expand Up @@ -282,8 +277,6 @@ contract MockGateway is IAxelarGatewayWithToken {
) internal {
address tokenAddress = tokenAddresses(symbol);

_setTokenMintAmount(symbol, tokenMintAmount(symbol) + amount);

if (_getTokenType(symbol) == TokenType.External) {
_callERC20Token(tokenAddress, abi.encodeWithSelector(IERC20.transfer.selector, account, amount));
} else {
Expand Down Expand Up @@ -323,10 +316,6 @@ contract MockGateway is IAxelarGatewayWithToken {
|* Pure Key Getters *|
\********************/

function _getTokenMintAmountKey(string memory symbol, uint256 day) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(PREFIX_TOKEN_DAILY_MINT_AMOUNT, symbol, day));
}

function _getTokenTypeKey(string memory symbol) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(PREFIX_TOKEN_TYPE, symbol));
}
Expand Down Expand Up @@ -395,10 +384,6 @@ contract MockGateway is IAxelarGatewayWithToken {
|* Internal Setters *|
\********************/

function _setTokenMintAmount(string memory symbol, uint256 amount) internal {
uints[_getTokenMintAmountKey(symbol, block.timestamp / 6 hours)] = amount;
}

function _setTokenType(string memory symbol, TokenType tokenType) internal {
uints[_getTokenTypeKey(symbol)] = uint256(tokenType);
}
Expand Down

0 comments on commit 855defe

Please sign in to comment.