Add authorization printer example

pull/21/head
Josselin 6 years ago
parent ab690d1f24
commit c442ec056e
  1. 25
      examples/printers/authorization.sol

@ -0,0 +1,25 @@
pragma solidity ^0.4.24;
contract Owner{
address owner;
modifier onlyOwner(){
require(msg.sender == owner);
_;
}
}
contract MyContract is Owner{
mapping(address => uint) balances;
constructor() public{
owner = msg.sender;
}
function mint(uint value) onlyOwner public{
balances[msg.sender] += value;
}
}
Loading…
Cancel
Save