ERC20Mintable contract call return wrong number

by Ntydrm   Last Updated August 13, 2019 12:28 PM - source

I use OpenZeppilin ERC20Mintable contract and add MaxSupply parameter to contraint the ERC20 token amount allowed to issue.

what I want is only permit contract ower to view MaxSupply info, my function is below:

uint256 MaxSupply;//contract static variable
// self defined function
function ViewMaxSupply() public view onlyMinter return(uint256) {
 return ( MaxSupply* (10 ** uint256(decimals)) );

decimals is equal to 18.

I found when I use onlyMiner modifier, the return value is a very strange number: 3963877391197344453575983046348115674221700746820753546331534351508065746944. when not use modifier onlyMinter, the result is correct: 100000000000000000000

How to fix the error? Thanks.

Related Questions

openzeppelin mint sequence

Updated August 09, 2019 22:28 PM

Ethereum Solidity Contracts w/ Fiat Money

Updated November 30, 2017 06:28 AM

How to call "modexp" precompiled contract from solidity?

Updated September 14, 2018 04:28 AM