diff --git a/contracts/upgradeable_contracts/amb_native_to_erc20/ForeignAMBNativeToErc20.sol b/contracts/upgradeable_contracts/amb_native_to_erc20/ForeignAMBNativeToErc20.sol index 84689806..f7887f3f 100644 --- a/contracts/upgradeable_contracts/amb_native_to_erc20/ForeignAMBNativeToErc20.sol +++ b/contracts/upgradeable_contracts/amb_native_to_erc20/ForeignAMBNativeToErc20.sol @@ -54,10 +54,9 @@ contract ForeignAMBNativeToErc20 is BasicAMBNativeToErc20, ReentrancyGuard, Base /** * @dev Public getter for token contract. - * Internal _erc677token() is hidden from the end users, in order to not confuse them with the supported token standard. * @return address of the used token contract */ - function erc20token() external view returns (ERC677) { + function erc677token() public view returns (ERC677) { return _erc677token(); } @@ -80,7 +79,7 @@ contract ForeignAMBNativeToErc20 is BasicAMBNativeToErc20, ReentrancyGuard, Base } } - IBurnableMintableERC677Token(_erc677token()).mint(_receiver, valueToMint); + IBurnableMintableERC677Token(erc677token()).mint(_receiver, valueToMint); emit TokensBridged(_receiver, valueToMint, _messageId); } @@ -90,7 +89,7 @@ contract ForeignAMBNativeToErc20 is BasicAMBNativeToErc20, ReentrancyGuard, Base * @param _value amount of tokens to be received */ function executeActionOnFixedTokens(address _receiver, uint256 _value) internal { - IBurnableMintableERC677Token(_erc677token()).mint(_receiver, _value); + IBurnableMintableERC677Token(erc677token()).mint(_receiver, _value); } /** @@ -118,7 +117,7 @@ contract ForeignAMBNativeToErc20 is BasicAMBNativeToErc20, ReentrancyGuard, Base // When transferFrom is called, after the transfer, the ERC677 token will call onTokenTransfer from this contract // which will call passMessage. require(!lock()); - ERC677 token = _erc677token(); + ERC677 token = erc677token(); address to = address(this); require(withinLimit(_value)); setTotalSpentPerDay(getCurrentDay(), totalSpentPerDay(getCurrentDay()).add(_value)); @@ -149,7 +148,7 @@ contract ForeignAMBNativeToErc20 is BasicAMBNativeToErc20, ReentrancyGuard, Base * otherwise it will be empty. */ function onTokenTransfer(address _from, uint256 _value, bytes _data) external bridgeMessageAllowed returns (bool) { - ERC677 token = _erc677token(); + ERC677 token = erc677token(); require(msg.sender == address(token)); if (!lock()) { require(withinLimit(_value)); @@ -180,7 +179,7 @@ contract ForeignAMBNativeToErc20 is BasicAMBNativeToErc20, ReentrancyGuard, Base * @param _fee amount of tokens to be minted. */ function onFeeDistribution(address _feeManager, uint256 _fee) internal { - IBurnableMintableERC677Token(_erc677token()).mint(_feeManager, _fee); + IBurnableMintableERC677Token(erc677token()).mint(_feeManager, _fee); } /** @@ -189,7 +188,7 @@ contract ForeignAMBNativeToErc20 is BasicAMBNativeToErc20, ReentrancyGuard, Base * @param _to address that will receive the locked tokens on this contract. */ function claimTokensFromErc677(address _token, address _to) external onlyIfUpgradeabilityOwner { - IBurnableMintableERC677Token(_erc677token()).claimTokens(_token, _to); + IBurnableMintableERC677Token(erc677token()).claimTokens(_token, _to); } /** diff --git a/test/amb_native_to_erc20/foreign_mediator.test.js b/test/amb_native_to_erc20/foreign_mediator.test.js index 1acf75ca..771c726a 100644 --- a/test/amb_native_to_erc20/foreign_mediator.test.js +++ b/test/amb_native_to_erc20/foreign_mediator.test.js @@ -74,7 +74,7 @@ contract('ForeignAMBNativeToErc20', async accounts => { expect(await contract.requestGasLimit()).to.be.bignumber.equal(ZERO) expect(await contract.decimalShift()).to.be.bignumber.equal(ZERO) expect(await contract.owner()).to.be.equal(ZERO_ADDRESS) - expect(await contract.erc20token()).to.be.equal(ZERO_ADDRESS) + expect(await contract.erc677token()).to.be.equal(ZERO_ADDRESS) expect(await contract.feeManagerContract()).to.be.equal(ZERO_ADDRESS) // When @@ -237,7 +237,7 @@ contract('ForeignAMBNativeToErc20', async accounts => { expect(await contract.requestGasLimit()).to.be.bignumber.equal(maxGasPerTx) expect(await contract.decimalShift()).to.be.bignumber.equal(ZERO) expect(await contract.owner()).to.be.equal(owner) - expect(await contract.erc20token()).to.be.equal(token.address) + expect(await contract.erc677token()).to.be.equal(token.address) expect(await contract.feeManagerContract()).to.be.equal(feeManager.address) expectEventInLogs(logs, 'ExecutionDailyLimitChanged', { newLimit: executionDailyLimit })