Skip to content

Instantly share code, notes, and snippets.

@zoernert
Created December 29, 2021 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoernert/449fd78d1336826725e5d3b1b58d1f1a to your computer and use it in GitHub Desktop.
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=
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