Skip to content

Instantly share code, notes, and snippets.

@ayinot
Created April 4, 2018 14:54
Show Gist options
  • Select an option

  • Save ayinot/90886366d84af082e6c3ab5ca4ac7d5d to your computer and use it in GitHub Desktop.

Select an option

Save ayinot/90886366d84af082e6c3ab5ca4ac7d5d to your computer and use it in GitHub Desktop.
related to contract upgradation
pragma solidity ^0.4.18;
import "./ShrimpCoin.sol";
contract MintableTokenDelegate is TokenDelegate {
modifier onlyOwner {
require(msg.sender == _storage.getAddress("owner"));
_;
}
modifier canMint() {
require(!_storage.getBool("mintingFinished"));
_;
}
function mint(address to, uint256 amount) onlyOwner canMint public returns (bool) {
addSupply(amount);
addBalance(to, amount);
return true;
}
function finishMinting() onlyOwner canMint public returns (bool) {
_storage.setBool("mintingFinished", true);
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment