Initial commit

This commit is contained in:
nolash 2020-12-11 07:48:54 +01:00
commit 02a0494f12
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
5 changed files with 95 additions and 0 deletions

19
AccountsIndex.sol Normal file
View File

@ -0,0 +1,19 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: GPL-3.0-or-later
// File-version: 1
abstract contract AccountsIndex {
address[] public accounts;
mapping(address => uint256) public accountsIndex;
uint256 public count;
event AccountAdded(address indexed addedAccount, uint256 indexed accountIndex);
function addWriter(address _writer) public virtual returns (bool);
function deleteWriter(address _writer) public virtual returns (bool);
function add(address _account) external virtual returns (bool);
function have(address _account) external virtual view returns (bool);
}

23
ERC20.sol Normal file
View File

@ -0,0 +1,23 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: GPL-3.0-or-later
// File-version: 1
// Description: The ERC20 standard interface as specified in EIP20 (sha256:9f843cbb25a737c9351b0b6a6f54b86864490d0d5284f6877b4929d481d34312)
abstract contract ERC20Core {
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
function transfer(address _to, uint256 _value) public virtual returns (bool);
function transferFrom(address _from, address _to, uint256 _value) public virtual returns (bool);
function approve(address _spender, uint256 _value) public virtual returns (bool);
}

17
Faucet.sol Normal file
View File

@ -0,0 +1,17 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: GPL-3.0-or-later
// File-version: 1
abstract contract Faucet {
uint256 public amount;
address public token;
event FaucetUsed(address indexed _recipient, address indexed _token, uint256 _value);
event FaucetFail(address indexed _recipient, address indexed _token, uint256 _value);
function setAmount(uint256 _amount) public virtual returns (bool);
function giveTo(address _recipient) public virtual returns (bool);
}

16
Makefile Normal file
View File

@ -0,0 +1,16 @@
# Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
# SPDX-License-Identifier: GPL-3.0-or-later
# File-version: 1
INPUTS = $(wildcard *.sol)
OUTPUTS = $(patsubst %.sol, %.abi, $(INPUTS))
%.abi:
solc $(basename $@).sol --abi | awk 'NR>3' > $@
all: $(OUTPUTS)
clean:
rm -vf *.abi
.PHONY: clean

20
TransferApproval.sol Normal file
View File

@ -0,0 +1,20 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: GPL-3.0-or-later
// File-version: 1
abstract contract TransferApproval {
uint256 public serial;
mapping(uint256 => address) public requests;
mapping(address => bool) public approvers;
event NewRequest(address indexed _sender, address indexed _recipient, address indexed _token, uint256 _value, uint256 _serial);
event NewExecution(uint256 serial);
event NewRejection(uint256 serial);
function request(address _recipient, address _token, uint256 _value) public virtual returns (uint256);
function execute(uint256 _serial) public virtual returns (bool);
function reject(uint256 _serial) public virtual returns (bool);
}