Update transferapproval interface

This commit is contained in:
nolash 2021-01-02 08:49:32 +01:00
parent 83eae00818
commit 82d37092c2
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
10 changed files with 26 additions and 76 deletions

View File

@ -1,24 +0,0 @@
FROM ethereum/solc:0.6.12
# The solc image messes up the alpine environment, so we have to go all over again
FROM alpine
COPY --from=0 /usr/bin/solc /usr/bin/solc
RUN apk update && \
apk add make
WORKDIR /usr/src
COPY ./Makefile ./cic-contracts/Makefile
COPY ./*.sol ./cic-contracts/
RUN cd cic-contracts && \
make -B && make install -B
#RUN mkdir -vp /usr/local/share/cic/solidity && \
# cp -rv cic-contracts/abis
LABEL authors="Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746"
LABEL spdx-license-identifier="GPL-3.0-or-later"
LABEL description="Ethereum smart contract interfaces used by the CIC component suite"
LABEL version="3"

View File

@ -2,16 +2,17 @@ pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: GPL-3.0-or-later
// File-version: 3
// File-version: 4
interface Faucet {
event FaucetUsed(address indexed _recipient, address indexed _token, uint256 _value);
event FaucetFail(address indexed _recipient, address indexed _token, uint256 _value);
event FaucetAmountChange(address indexed _token, uint256 _value);
function amount() external view returns (uint256);
function token() external view returns (address);
function setAmount(uint256 _amount) external returns (bool);
function giveTo(address _recipient) external returns (bool);
function gimme() external returns (bool);
function cooldown(address _recipient) external return (uint256);
}

View File

@ -8,4 +8,5 @@ pragma solidity >=0.6.12;
interface RegistryClient {
function registryCount() external view returns (uint256);
function addressOf(bytes32) external view returns (address);
function entry(uint256) external view returns (address);
}

View File

@ -9,4 +9,5 @@ interface RegistryStandard {
function registryCount() external view returns (uint256);
function addressOf(bytes32) external view returns (address);
function register(bytes32,address) external view returns (bool);
function entry(uint256) external view returns (address);
}

View File

@ -1,3 +0,0 @@
interface TokenEndorser {
function getBySymbol(address _tokenAddress) external view returns ( bytes32 );
}

View File

@ -1,18 +0,0 @@
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)
// TODO: Rename everything to something more generic
interface TokenEndorser {
function endorsement(bytes32) external view returns ( bytes32 );
function tokenIndex(address) external view returns ( uint256 );
function endorser(address, uint256) external view returns ( uint256 );
function endorserTokenCount(address) external view returns ( uint256 );
function tokenSymbolIndex(string memory) external view returns ( address );
function tokens(uint256) external view returns ( address );
function add(address _token, bytes32 _data) external returns ( bool );
}

View File

@ -1,18 +0,0 @@
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)
// TODO: Rename everything to something more generic
interface TokenEndorser {
function endorsement(bytes32) external view returns ( bytes32 );
function tokenIndex(address) external view returns ( uint256 );
function endorser(address, uint256) external view returns ( uint256 );
function endorserTokenCount(address) external view returns ( uint256 );
function tokenSymbolIndex(string memory) external view returns ( address );
function tokens(uint256) external view returns ( address );
function add(address _token, bytes32 _data) external returns ( bool );
}

View File

@ -9,11 +9,23 @@ interface TransferApproval {
event NewRequest(address indexed _sender, address indexed _recipient, address indexed _token, uint256 _value, uint256 _serial);
event NewExecution(uint256 serial);
event NewRejection(uint256 serial);
event TransferFail(uint256 serial);
function serial() external view returns (uint256);
function requests(uint256) external view returns (address);
function approvers(address) external view returns(bool);
function request(address _recipient, address _token, uint256 _value) external returns (uint256);
function execute(uint256 _serial) external returns (bool);
function reject(uint256 _serial) external returns (bool);
struct Transaction {
uint256 serial;
address sender;
address recipient;
address token;
uint256 value;
}
function approvers() external view return (address[]);
function count() external view returns (uint256);
function lastSerial() external view returns (uint256);
function nextSerial() external view returns (uint256);
function getSerialAt(uint256 _idx) external view returns (uint256);
function requests(uint256 _idx) external view returns (Transaction);
function createRequest(address _recipient, address _token, uint256 _value) external returns (uint256);
function executeRequest(uint256 _serial) external returns (bool);
function rejectRequest(uint256 _serial) external returns (bool);
}

View File

@ -1,3 +0,0 @@
#!/bin/bash
docker build -t grassrootseconomics:cic .

View File

@ -9,8 +9,9 @@ while True:
l = f.readline()
if l == '':
break
print('line {}'.format(l))
#print('line {}'.format(l))
h = web3.Web3.keccak(text=l)
z = bytes([a ^ b for a, b in zip(h, z)])
print(h.hex(), z.hex())
#print(h.hex(), z.hex())
f.close()
print(h[:4].hex())