Add back ERC interfaces

This commit is contained in:
lash 2023-03-25 12:32:56 +00:00
parent a28cfdbb36
commit 46cc35b54c
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
27 changed files with 198 additions and 30 deletions

View File

@ -1,6 +1,6 @@
@subsection Multihash
A complement to @code{Locator}, enabling validation and generation for multihashes that have been registered to the contract.
A complement to @code{Locator}, enabling validation and generation of multihashes for multicodecs that have been registered to the contract.
@table @dfn

View File

@ -14,6 +14,7 @@ CIC smart contracts are implemented using the @emph{solidity} programming langua
The following well-known solidity interfaces are used directly.
@itemize @bullet
@item
@uref{https://eips.ethereum.org/EIPS/eip-20, ERC20 - Token Standard}
@ -26,7 +27,7 @@ The following well-known solidity interfaces are used directly.
@end itemize
@subsection Extended ERC definitions
@subsection Partial use
@itemize @dfn
@item
@ -34,7 +35,7 @@ The following well-known solidity interfaces are used directly.
@end itemize
@section Native implementations
@section Native interfaces
@include accountsindex.sol.texi
@ -56,5 +57,6 @@ The following well-known solidity interfaces are used directly.
@include registry.sol.texi
@include writer.sol.texi
@include seal.sol.texi
@include writer.sol.texi

View File

@ -16,7 +16,7 @@ Unique (ERC20) token symbol resolver.
@include ../../build/RegistryClient.interface
@item Solidity interface definition
@include ../../build/contract_RegistryClient.texi
@item Reference implementation
@item Contract registry implementation
@uref{git://holbrook.no/eth-contract-registry.git,}
@item Token index implementation
@uref{git://holbrook.no/eth-contract-registry.git,}

View File

@ -2,7 +2,9 @@
A complement to ERC173, which allows definition of a class of super-users for a contract.
Typically, a super-user address may perform @emph{more} actions than a "normal" address, aswell as @emph{some} actions normally limited to the @emph{contract owner}.
A super-user address may perform @emph{more} actions than a "normal" address, aswell as @emph{some} actions normally limited to the @emph{contract owner}.
No super-user should be able to perform actions that @emph{contract owner} cannot perform.
Typically, only the @emph{contract owner} can add or remove a super-user.

View File

@ -4,7 +4,7 @@ pragma solidity >=0.6.12;
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 5
interface AccountsIndex {
interface IAccountsIndex {
event AddressAdded(address indexed addedAccount, uint256 indexed accountIndex); // AccountsIndex
event AddressActive(address indexed _executor, address indexed _account, bool _active);
event AddressRemoved(address indexed _executor, address _account);

View File

@ -1,10 +1,10 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 3
interface Burner {
interface IBurner {
// Token(s) successfully burned; by who and how much.
event Burn(address indexed _burner, uint256 _burned);

View File

@ -4,7 +4,7 @@ pragma solidity >=0.6.12;
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 3
interface Declarator {
interface IDeclarator {
event DeclarationAdded(address indexed _declarator, address indexed _subject, bytes32 indexed _topic, bytes32 _proof);
// Get all declarations for a subject (without topic) signed by a declarator

12
solidity/ERC165.sol Normal file
View File

@ -0,0 +1,12 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 4
// This is a representation of an officially approved Ethereum Improvement Proposal, written by Christian Reitwießner chris@ethereum.org, Nick Johnson nick@ethereum.org, Fabian Vogelsteller fabian@lukso.network, Jordi Baylina jordi@baylina.cat, Konrad Feldmeier konrad.feldmeier@brainbot.com and William Entriken github.com@phor.net. It was released under the CC0 license.
// The proposal source used as reference was a Markdown file with the following digests:
// - sha256:2fc8534206e1e5b7abbb9db21fa5b83d39c51b2dabad441a356b7d18320bfc51
interface IERC165 {
function supportsInterface(bytes4 _sum) external pure returns (bool);
}

16
solidity/ERC173.sol Normal file
View File

@ -0,0 +1,16 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 3
// This is a representation of an officially approved Ethereum Improvement Proposal, written by Nick Mudge <nick@perfectabstractions.com> and Dan Finlay <dan@danfinlay.com> and released under the CC0 license.
// The proposal source used as reference was a Markdown file with the following digests:
// - sha256:45e14ac315e380b5372a5ffc6783ab11d7eafb7fa5a123e0b8e5fc8c6c527c4c
// - swarmhash:0cadf6a7122d2da20dbab0ef31c692b1b24cf49ae5c1c80f7ce6dbae8885ce01
interface IERC173 {
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function owner() external view returns (address);
function transferOwnership(address _newOwner) external view returns (bool);
}

24
solidity/ERC20.sol Normal file
View File

@ -0,0 +1,24 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 3
// This is a representation of an officially approved Ethereum Improvement Proposal, written by Fabian Vogelsteller fabian@ethereum.org, Vitalik Buterin vitalik.buterin@ethereum.org. It was released under the CC0 license.
// The proposal source used as reference was a Markdown file with the following digests:
// - sha256:d120f321f2bef19596a401fba86d13352693ccd39645c2bbc84ffb3ed551388f
// - swarmhash:598f13429ec42f50d7a6576ab20feffdaf2135a90805678d24e4ea297bf0e639
interface IERC20 {
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) external returns (bool);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool);
function approve(address _spender, uint256 _value) external returns (bool);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint256);
function totalSupply() external view returns (uint256);
function allowance(address _owner, address _spender) external view returns(uint256);
function balanceOf(address _holder) external view returns (uint256);
}

14
solidity/ERC5679Ext20.sol Normal file
View File

@ -0,0 +1,14 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 1
// This is a representation of an officially approved Ethereum Improvement Proposal, Zainan Victor Zhou (@xinbenlv).
// The proposal source used as reference was a Markdown file with the following digests:
// - sha256:7e799dd22588f62c52c4886d7b523c12696441a6c2350b739562ea8fb5d60649
interface IERC5679Ext20 {
function mint(address _to, uint256 _amount, bytes calldata _data) external;
function burn(address _from, uint256 _amount, bytes calldata _data) external;
}

View File

@ -0,0 +1,14 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 2
// This is a representation of an officially approved Ethereum Improvement Proposal, Zainan Victor Zhou (@xinbenlv).
// The proposal source used as reference was a Markdown file with the following digests:
// - sha256:7e799dd22588f62c52c4886d7b523c12696441a6c2350b739562ea8fb5d60649
interface IERC5679Ext721 {
function safeMint(address _to, uint256 _id, bytes calldata _data) external;
function burn(address _from, uint256 _id, bytes calldata _data) external;
}

25
solidity/ERC721.sol Normal file
View File

@ -0,0 +1,25 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 3
// This is a representation of an officially approved Ethereum Improvement Proposal, William Entriken (@fulldecent), Dieter Shirley dete@axiomzen.co, Jacob Evans jacob@dekz.net, Nastassia Sachs nastassia.sachs@protonmail.com
// The proposal source used as reference was a Markdown file with the following digests:
// - sha256:f25b41ad1bff14ec57e8c247f2ecf372fd86245d08ba3cbd005c21a42744a7ca
// - swarmhash:cf43d96b21b0b017ae32fb2ac8df9268f13344d9fd20aa1d959453eaf379a51b
interface IERC721 {
event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId);
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);
function balanceOf(address _owner) external view returns (uint256);
function ownerOf(uint256 _tokenId) external view returns (address);
function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable;
function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes memory _data) external payable;
function transferFrom(address _from, address _to, uint256 _tokenId) external payable;
function approve(address _approved, uint256 _tokenId) external payable;
function setApprovalForAll(address _operator, bool _approved) external;
function getApproved(uint256 _tokenId) external view returns (address);
function isApprovedForAll(address _owner, address _operator) external view returns (bool);
}

View File

@ -0,0 +1,15 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 2
// This is a representation of an officially approved Ethereum Improvement Proposal, William Entriken (@fulldecent), Dieter Shirley dete@axiomzen.co, Jacob Evans jacob@dekz.net, Nastassia Sachs nastassia.sachs@protonmail.com
// The proposal source used as reference was a Markdown file with the following digests:
// - sha256:f25b41ad1bff14ec57e8c247f2ecf372fd86245d08ba3cbd005c21a42744a7ca
// - swarmhash:cf43d96b21b0b017ae32fb2ac8df9268f13344d9fd20aa1d959453eaf379a51b
interface IERC721Enumerable {
function totalSupply() external view returns (uint256);
function tokenByIndex(uint256 _index) external view returns (uint256);
function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256);
}

View File

@ -0,0 +1,15 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 2
// This is a representation of an officially approved Ethereum Improvement Proposal, William Entriken (@fulldecent), Dieter Shirley dete@axiomzen.co, Jacob Evans jacob@dekz.net, Nastassia Sachs nastassia.sachs@protonmail.com
// The proposal source used as reference was a Markdown file with the following digests:
// - sha256:f25b41ad1bff14ec57e8c247f2ecf372fd86245d08ba3cbd005c21a42744a7ca
// - swarmhash:cf43d96b21b0b017ae32fb2ac8df9268f13344d9fd20aa1d959453eaf379a51b
interface IERC721Metadata {
function name() external view returns (string memory _name);
function symbol() external view returns (string memory _symbol);
function tokenURI(uint256 _tokenId) external view returns (string memory);
}

View File

@ -0,0 +1,13 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 2
// This is a representation of an officially approved Ethereum Improvement Proposal, William Entriken (@fulldecent), Dieter Shirley dete@axiomzen.co, Jacob Evans jacob@dekz.net, Nastassia Sachs nastassia.sachs@protonmail.com
// The proposal source used as reference was a Markdown file with the following digests:
// - sha256:f25b41ad1bff14ec57e8c247f2ecf372fd86245d08ba3cbd005c21a42744a7ca
// - swarmhash:cf43d96b21b0b017ae32fb2ac8df9268f13344d9fd20aa1d959453eaf379a51b
interface IERC721Receiver {
function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes memory _data) external returns(bytes4);
}

View File

@ -1,10 +1,10 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 2
interface Expire {
interface IExpire {
// Expiration timestamp has been changed.
event Expired(uint256 _timestamp);

View File

@ -1,10 +1,10 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 6
interface Faucet {
interface IFaucet {
// Tokens were given to an address
event Give(address indexed _recipient, address indexed _token, uint256 _value);

View File

@ -1,7 +1,7 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 3
interface ILocator {

View File

@ -1,10 +1,10 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 2
interface Minter {
interface IMinter {
// Tokens are successfully minted; by who, to whom and how much
event Mint(address indexed _minter, address indexed _beneficiary, uint256 value);

View File

@ -1,7 +1,7 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 2
interface IMultiHash {

View File

@ -1,9 +1,9 @@
pragma solidity ^0.8.0;
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: GPL-3.0-or-later
// File-version: 1
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 2
interface OwnerAcceptable {
interface IOwnerAcceptable {
function acceptOwnership() external view returns (bool);
}

View File

@ -1,8 +1,8 @@
pragma solidity ^0.8.0;
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: GPL-3.0-or-later
// File-version: 1
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 2
interface OwnerTakeable {
event OwnershipTaken(address _result);

View File

@ -4,7 +4,7 @@ pragma solidity >=0.6.12;
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 3
interface Registry {
interface IRegistry {
function set(bytes32, address) external returns (bool);
function bind(bytes32, bytes32) external returns (bool);
}

View File

@ -4,7 +4,7 @@ pragma solidity >=0.6.12;
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 3
interface RegistryClient {
interface IRegistryClient {
// Return the address of the contract identified by the given byte string
function addressOf(bytes32) external view returns (address);

16
solidity/Seal.sol Normal file
View File

@ -0,0 +1,16 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 1
interface ISeal {
// Seal state has changed.
event SealStateChange(bool indexed _final, uint256 _sealState);
// The current seal state.
function sealState() external view returns(uint256);
// The numeric seal state in everything sealable has been sealed.
function maxSealState() external view returns(uint256);
}

View File

@ -1,10 +1,10 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: GPL-3.0-or-later
// File-version: 2
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 3
interface Writer {
interface IWriter {
// A writer has been added by _executor
event WriterAdded(address indexed _executor, address _writer);