Created
December 29, 2021 11:56
-
-
Save zoernert/449fd78d1336826725e5d3b1b58d1f1a to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.11+commit.d7f03943.js&optimize=true&runs=200&gist=
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.8.0; | |
contract espledger { | |
mapping (address => uint256) public balanceDebit; | |
mapping (address => uint256) public balanceCredit; | |
uint256 public totalSupply = 0; | |
address public owner; | |
address public secondOwner; | |
event Transfer(address indexed from, address indexed to, uint256 value); | |
modifier _ownerOnly() { | |
require((msg.sender == owner) || (msg.sender == secondOwner)); | |
_; | |
} | |
constructor(address _owner) { | |
owner = msg.sender; | |
secondOwner = _owner; | |
} | |
function transfer(address from,address to, uint256 value) public _ownerOnly returns (bool success) { | |
balanceCredit[from] += value; | |
balanceDebit[to] += value; | |
totalSupply += value; | |
emit Transfer(from, to, value); | |
return true; | |
} | |
// more stuff to come | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment