Restructure texinfo to improve readme formatting for code example

This commit is contained in:
lash 2023-08-02 10:19:33 +01:00
parent e3d0704d4f
commit f9d2af2e3b
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
18 changed files with 313 additions and 173 deletions

140
README.md
View File

@ -132,10 +132,12 @@ Attached to `ERC20` and `ERC721` tokens that may be *burned*.
Implements the `burn(...)` part of `ERC5679` for interoperability. Implements the `burn(...)` part of `ERC5679` for interoperability.
ERC165 Interface identifier #### ERC165 Interface identifier
b1110c1b b1110c1b
Solidity interface definition #### Solidity interface definition
interface IBurner { interface IBurner {
// Token(s) successfully burned; by who and how much. // Token(s) successfully burned; by who and how much.
event Burn(address indexed _burner, uint256 _burned); event Burn(address indexed _burner, uint256 _burned);
@ -158,7 +160,8 @@ Solidity interface definition
function totalMinted() external returns (uint256); function totalMinted() external returns (uint256);
} }
Example implementation #### Example implementation
<https://git.grassecon.net/cicnet/erc20-demurrage-token.git> <https://git.grassecon.net/cicnet/erc20-demurrage-token.git>
### Chrono ### Chrono
@ -167,17 +170,20 @@ Define a creation time for a resource.
Complements `ERC5007`. Complements `ERC5007`.
ERC165 Interface identifier #### ERC165 Interface identifier
4db1ccd4 4db1ccd4
Solidity interface definition #### Solidity interface definition
interface IChrono { interface IChrono {
// Returns the timestamp of when a resource corresponding to _idx was first created. // Returns the timestamp of when a resource corresponding to _idx was first created.
// int64 chosen as return value for simpler interoperability with ERC5007. // int64 chosen as return value for simpler interoperability with ERC5007.
function createTime(uint256 _idx) external returns(int64); function createTime(uint256 _idx) external returns(int64);
} }
Example implementation #### Example implementation
<https://git.defalsify.org/eth-erc721> (BadgeToken contract) <https://git.defalsify.org/eth-erc721> (BadgeToken contract)
### Declarator ### Declarator
@ -197,10 +203,12 @@ Any number of claims can be made about an address under any number of
topics. All claims must be stored, and returned in the order which they topics. All claims must be stored, and returned in the order which they
were added. were added.
ERC165 Interface identifier #### ERC165 Interface identifier
21b7493b 21b7493b
Solidity interface definition #### Solidity interface definition
interface IDeclarator { interface IDeclarator {
event DeclarationAdded(address indexed _declarator, address indexed _subject, bytes32 indexed _topic, bytes32 _proof); event DeclarationAdded(address indexed _declarator, address indexed _subject, bytes32 indexed _topic, bytes32 _proof);
@ -229,7 +237,8 @@ Solidity interface definition
function declaratorCount(address _subject) external view returns ( uint256 ); function declaratorCount(address _subject) external view returns ( uint256 );
} }
Reference implementation #### Reference implementation
<git://holbrook.no/eth-address-index.git> <git://holbrook.no/eth-address-index.git>
### Digest ### Digest
@ -242,10 +251,12 @@ Primary use-case is the abstraction of self-describing
A default encoding *must* always be defined, and the encoding of a valid A default encoding *must* always be defined, and the encoding of a valid
digest *must* succeed with the default encoding. digest *must* succeed with the default encoding.
ERC165 Interface identifier #### ERC165 Interface identifier
982ab05d 982ab05d
Solidity interface definition #### Solidity interface definition
interface IDigest { interface IDigest {
// Returns the default digest encoding used by the contract instance. // Returns the default digest encoding used by the contract instance.
function defaultDigestEncoding() external view returns (uint256 _encoding); function defaultDigestEncoding() external view returns (uint256 _encoding);
@ -264,7 +275,8 @@ Solidity interface definition
function encodeDigest(bytes memory _data) external view returns (bytes memory); function encodeDigest(bytes memory _data) external view returns (bytes memory);
} }
Example implementation #### Example implementation
<git://holbrook.no/eth-event-msg.git> <git://holbrook.no/eth-event-msg.git>
### Expire ### Expire
@ -275,10 +287,12 @@ change*.
A contract defining an expiry *must not* allow changing the expiration A contract defining an expiry *must not* allow changing the expiration
time to a time in the past. time to a time in the past.
ERC165 Interface identifier #### ERC165 Interface identifier
841a0e94 841a0e94
Solidity interface definition #### Solidity interface definition
interface IExpire { interface IExpire {
// Contract has expired. // Contract has expired.
event Expired(uint256 _timestamp); event Expired(uint256 _timestamp);
@ -297,7 +311,8 @@ Solidity interface definition
function applyExpiry() external returns(uint8); function applyExpiry() external returns(uint8);
} }
Example implementation #### Example implementation
<https://git.grassecon.net/cicnet/erc20-demurrage-token.git> <https://git.grassecon.net/cicnet/erc20-demurrage-token.git>
### Faucet ### Faucet
@ -332,10 +347,12 @@ amount to dispense.
The *check(address)* contract call *must* evaluate all four criteria, The *check(address)* contract call *must* evaluate all four criteria,
and *must* return `false` if any of the criteria are not met. and *must* return `false` if any of the criteria are not met.
ERC165 Interface identifier #### ERC165 Interface identifier
1a3ac634 1a3ac634
Solidity interface definition #### Solidity interface definition
interface IFaucet { interface IFaucet {
// Tokens were given to an address // Tokens were given to an address
event Give(address indexed _recipient, address indexed _token, uint256 _value); event Give(address indexed _recipient, address indexed _token, uint256 _value);
@ -370,7 +387,8 @@ Solidity interface definition
function nextBalance(address _recipient) external returns (uint256); function nextBalance(address _recipient) external returns (uint256);
} }
Reference implementations #### Reference implementations
- <git://holbrook.no/erc20-faucet.git> - <git://holbrook.no/erc20-faucet.git>
- <git://holbrook.no/eth-faucet.git> - <git://holbrook.no/eth-faucet.git>
@ -389,10 +407,12 @@ the content address.
Furthermore, it *should* be possible to refer to a resource by a Furthermore, it *should* be possible to refer to a resource by a
fully-qualified location on the web or an overlay network (e.g. tor). fully-qualified location on the web or an overlay network (e.g. tor).
ERC165 Interface identifier #### ERC165 Interface identifier
ed75b333 ed75b333
Solidity interface definition #### Solidity interface definition
interface ILocator { interface ILocator {
// URI that may or may not point to a specific resource location. // URI that may or may not point to a specific resource location.
function toURI(bytes memory _data) external view returns (string memory); function toURI(bytes memory _data) external view returns (string memory);
@ -401,10 +421,11 @@ Solidity interface definition
function toURL(bytes memory _data) external view returns(string memory); function toURL(bytes memory _data) external view returns(string memory);
} }
Example implementation #### Example implementation
<git://holbrook.no/eth-event-msg.git> <git://holbrook.no/eth-event-msg.git>
#### Expressing locators in terms of numetic token id #### Expressing locators in terms of numeric token id
Given the numeric token id `1234567890987654321` (`0x112210f4b16c1cb1` Given the numeric token id `1234567890987654321` (`0x112210f4b16c1cb1`
hex), and a base url `https://contentgateway.grassecon.net`, the result hex), and a base url `https://contentgateway.grassecon.net`, the result
@ -463,10 +484,12 @@ Attached to `ERC20` and `ERC721` tokens that may be minted.
Implements the `mint(...)` and `safeMint(...)` parts of `ERC5679` for Implements the `mint(...)` and `safeMint(...)` parts of `ERC5679` for
interoperability. interoperability.
ERC165 Interface identifier #### ERC165 Interface identifier
5878bcf4 5878bcf4
Solidity interface definition #### Solidity interface definition
interface IMinter { interface IMinter {
// Tokens are successfully minted; by who, to whom and how much // Tokens are successfully minted; by who, to whom and how much
event Mint(address indexed _minter, address indexed _beneficiary, uint256 value); event Mint(address indexed _minter, address indexed _beneficiary, uint256 value);
@ -484,7 +507,8 @@ Solidity interface definition
function safeMint(address _beneficiary, uint256 value, bytes calldata _data) external; function safeMint(address _beneficiary, uint256 value, bytes calldata _data) external;
} }
Example implementation #### Example implementation
<https://git.grassecon.net/cicnet/erc20-demurrage-token.git> <https://git.grassecon.net/cicnet/erc20-demurrage-token.git>
### Msg ### Msg
@ -497,10 +521,12 @@ The reference may or may not be mutable.
The interface complements `Locator` and `MultiHash` to generate locators The interface complements `Locator` and `MultiHash` to generate locators
for how to resolve the reference. for how to resolve the reference.
ERC165 Interface identifier #### ERC165 Interface identifier
a3002595 a3002595
Solidity interface definition #### Solidity interface definition
interface IMsg { interface IMsg {
// Emitted when a new message digest has been set // Emitted when a new message digest has been set
// Should not be emitted if the digest set is identical to the previous // Should not be emitted if the digest set is identical to the previous
@ -510,7 +536,8 @@ Solidity interface definition
function getMsg() external view returns(bytes memory); function getMsg() external view returns(bytes memory);
} }
Example implementation #### Example implementation
<git://holbrook.no/eth-event-msg.git> <git://holbrook.no/eth-event-msg.git>
### Registry ### Registry
@ -524,10 +551,12 @@ It currently has two distinct uses in the CIC context:
2. Unique (ERC20) token symbol resolver. 2. Unique (ERC20) token symbol resolver.
ERC165 Interface identifier #### ERC165 Interface identifier
effbf671 effbf671
Solidity interface definition #### Solidity interface definition
interface IRegistryClient { interface IRegistryClient {
// Address added to store with the given key // Address added to store with the given key
event AddressKey(bytes32 indexed _key, address _address); event AddressKey(bytes32 indexed _key, address _address);
@ -542,10 +571,12 @@ Solidity interface definition
function identifierCount() external view returns (uint256); function identifierCount() external view returns (uint256);
} }
Contract registry implementation #### Contract registry implementation
<git://holbrook.no/eth-contract-registry.git> <git://holbrook.no/eth-contract-registry.git>
Token index implementation #### Token index implementation
<git://holbrook.no/eth-contract-registry.git> <git://holbrook.no/eth-contract-registry.git>
### Seal ### Seal
@ -574,10 +605,12 @@ Use cases of sealing include:
- The expiry time of a token (see `Expire`) - The expiry time of a token (see `Expire`)
ERC165 Interface identifier #### ERC165 Interface identifier
0d7491f8 0d7491f8
Solidity interface definition #### Solidity interface definition
interface ISeal { interface ISeal {
// Seal state has changed. // Seal state has changed.
event SealStateChange(bool indexed _final, uint256 _sealState); event SealStateChange(bool indexed _final, uint256 _sealState);
@ -589,7 +622,8 @@ Solidity interface definition
function maxSealState() external view returns(uint256); function maxSealState() external view returns(uint256);
} }
Example implementation #### Example implementation
<https://git.grassecon.net/cicnet/erc20-demurrage-token.git> <https://git.grassecon.net/cicnet/erc20-demurrage-token.git>
### TokenRateChange ### TokenRateChange
@ -602,10 +636,12 @@ frequency for which the rate of change is applied.
A method for canonical value change calculations is also provided. A method for canonical value change calculations is also provided.
ERC165 Interface identifier #### ERC165 Interface identifier
b716af03 b716af03
Solidity interface definition #### Solidity interface definition
interface ITokenChangeRate { interface ITokenChangeRate {
// Time unit resolution for rate of change. // Time unit resolution for rate of change.
// A value of 0 indicates no rate of change, // A value of 0 indicates no rate of change,
@ -628,7 +664,8 @@ Solidity interface definition
function applyChange(int256 _value, uint256 _changeTimeUnits) external view returns(int256); function applyChange(int256 _value, uint256 _changeTimeUnits) external view returns(int256);
} }
Reference implementations #### Reference implementations
- <git://holbrook.no/erc20-demurrage-token.git> - <git://holbrook.no/erc20-demurrage-token.git>
### TokenSwap ### TokenSwap
@ -636,10 +673,12 @@ Reference implementations
Token swap interface that can fit token escrow aswell as token swap Token swap interface that can fit token escrow aswell as token swap
contracts. contracts.
ERC165 Interface identifier #### ERC165 Interface identifier
9e2d0236 9e2d0236
Solidity interface definition #### Solidity interface definition
interface ITokenSwap { interface ITokenSwap {
// Add inToken liquidity of the full balance of the sender // Add inToken liquidity of the full balance of the sender
// Requires token approval for the balance. // Requires token approval for the balance.
@ -660,7 +699,8 @@ Solidity interface definition
function withdraw(address _outToken, address _inToken, uint256 _value) external returns (uint256); function withdraw(address _outToken, address _inToken, uint256 _value) external returns (uint256);
} }
Reference implementations #### Reference implementations
- <git://holbrook.no/erc20-vend.git> - <git://holbrook.no/erc20-vend.git>
### TokenVote ### TokenVote
@ -675,10 +715,12 @@ Voted tokens **SHOULD** be locked until the voting has finalized.
Finalization of voting should be callable by anyone. Finalization of voting should be callable by anyone.
ERC165 Interface identifier #### ERC165 Interface identifier
f2e0bfeb f2e0bfeb
Solidity interface definition #### Solidity interface definition
interface ITokenVote { interface ITokenVote {
// A new proposal has been created. // A new proposal has been created.
@ -734,7 +776,8 @@ Solidity interface definition
function finalize() external returns (bool); function finalize() external returns (bool);
} }
Reference implementations #### Reference implementations
- <git://holbrook.no/evm-tokenvote.git> - <git://holbrook.no/evm-tokenvote.git>
### Writer ### Writer
@ -759,10 +802,12 @@ Some use-case examples of super-user actions include:
- Edit access control lists. - Edit access control lists.
ERC165 Interface identifier #### ERC165 Interface identifier
abe1f1f5 abe1f1f5
Solidity interface definition #### Solidity interface definition
interface IWriter { interface IWriter {
// A writer has been added by _executor // A writer has been added by _executor
event WriterAdded(address _writer); event WriterAdded(address _writer);
@ -780,5 +825,6 @@ Solidity interface definition
function isWriter(address _writer) external view returns (bool); function isWriter(address _writer) external view returns (bool);
} }
Example implementation #### Example implementation
<https://git.grassecon.net/cicnet/erc20-demurrage-token.git> <https://git.grassecon.net/cicnet/erc20-demurrage-token.git>

View File

@ -4,11 +4,14 @@ Attached to @code{ERC20} and @code{ERC721} tokens that may be @emph{burned}.
Implements the @code{burn(...)} part of @code{ERC5679} for interoperability. Implements the @code{burn(...)} part of @code{ERC5679} for interoperability.
@table @dfn @subsubsection ERC165 Interface identifier
@item ERC165 Interface identifier
@include ../../build/Burner.interface @include ../../build/Burner.interface
@item Solidity interface definition
@subsubsection Solidity interface definition
@include ../../build/contract_Burner.texi @include ../../build/contract_Burner.texi
@item Example implementation
@subsubsection Example implementation
@uref{https://git.grassecon.net/cicnet/erc20-demurrage-token.git} @uref{https://git.grassecon.net/cicnet/erc20-demurrage-token.git}
@end table

View File

@ -5,11 +5,14 @@ Define a creation time for a resource.
Complements @code{ERC5007}. Complements @code{ERC5007}.
@table @dfn @subsubsection ERC165 Interface identifier
@item ERC165 Interface identifier
@include ../../build/Chrono.interface @include ../../build/Chrono.interface
@item Solidity interface definition
@subsubsection Solidity interface definition
@include ../../build/contract_Chrono.texi @include ../../build/contract_Chrono.texi
@item Example implementation
@subsubsection Example implementation
@uref{https://git.defalsify.org/eth-erc721} (BadgeToken contract) @uref{https://git.defalsify.org/eth-erc721} (BadgeToken contract)
@end table

View File

@ -10,11 +10,14 @@ Claims may be made with or without topics. A missing topic is synonymous with a
Any number of claims can be made about an address under any number of topics. All claims must be stored, and returned in the order which they were added. Any number of claims can be made about an address under any number of topics. All claims must be stored, and returned in the order which they were added.
@table @dfn @subsubsection ERC165 Interface identifier
@item ERC165 Interface identifier
@include ../../build/Declarator.interface @include ../../build/Declarator.interface
@item Solidity interface definition
@subsubsection Solidity interface definition
@include ../../build/contract_Declarator.texi @include ../../build/contract_Declarator.texi
@item Reference implementation
@subsubsection Reference implementation
@uref{git://holbrook.no/eth-address-index.git,} @uref{git://holbrook.no/eth-address-index.git,}
@end table

View File

@ -7,11 +7,14 @@ Primary use-case is the abstraction of self-describing @uref{https://multiformat
A default encoding @emph{must} always be defined, and the encoding of a valid digest @emph{must} succeed with the default encoding. A default encoding @emph{must} always be defined, and the encoding of a valid digest @emph{must} succeed with the default encoding.
@table @dfn @subsubsection ERC165 Interface identifier
@item ERC165 Interface identifier
@include ../../build/Digest.interface @include ../../build/Digest.interface
@item Solidity interface definition
@subsubsection Solidity interface definition
@include ../../build/contract_Digest.texi @include ../../build/contract_Digest.texi
@item Example implementation
@subsubsection Example implementation
@uref{git://holbrook.no/eth-event-msg.git} @uref{git://holbrook.no/eth-event-msg.git}
@end table

View File

@ -5,11 +5,14 @@ Defines an expiry time after which token balances or supply @emph{cannot change}
A contract defining an expiry @emph{must not} allow changing the expiration time to a time in the past. A contract defining an expiry @emph{must not} allow changing the expiration time to a time in the past.
@table @dfn @subsubsection ERC165 Interface identifier
@item ERC165 Interface identifier
@include ../../build/Expire.interface @include ../../build/Expire.interface
@item Solidity interface definition
@subsubsection Solidity interface definition
@include ../../build/contract_Expire.texi @include ../../build/contract_Expire.texi
@item Example implementation
@subsubsection Example implementation
@uref{https://git.grassecon.net/cicnet/erc20-demurrage-token.git} @uref{https://git.grassecon.net/cicnet/erc20-demurrage-token.git}
@end table

View File

@ -24,16 +24,19 @@ The contract has sufficient token funds to dispense the current defined amount t
The @emph{check(address)} contract call @emph{must} evaluate all four criteria, and @emph{must} return @code{false} if any of the criteria are not met. The @emph{check(address)} contract call @emph{must} evaluate all four criteria, and @emph{must} return @code{false} if any of the criteria are not met.
@table @dfn @subsubsection ERC165 Interface identifier
@item ERC165 Interface identifier
@include ../../build/Faucet.interface @include ../../build/Faucet.interface
@item Solidity interface definition
@subsubsection Solidity interface definition
@include ../../build/contract_Faucet.texi @include ../../build/contract_Faucet.texi
@item Reference implementations
@subsubsection Reference implementations
@itemize @itemize
@item @item
@uref{git://holbrook.no/erc20-faucet.git,} @uref{git://holbrook.no/erc20-faucet.git,}
@item @item
@uref{git://holbrook.no/eth-faucet.git,} @uref{git://holbrook.no/eth-faucet.git,}
@end itemize @end itemize
@end table

View File

@ -8,17 +8,20 @@ It @emph{must} be possible to refer to all off-chain resources directly by the c
Furthermore, it @emph{should} be possible to refer to a resource by a fully-qualified location on the web or an overlay network (e.g. tor). Furthermore, it @emph{should} be possible to refer to a resource by a fully-qualified location on the web or an overlay network (e.g. tor).
@table @dfn @subsubsection ERC165 Interface identifier
@item ERC165 Interface identifier
@include ../../build/Locator.interface @include ../../build/Locator.interface
@item Solidity interface definition
@subsubsection Solidity interface definition
@include ../../build/contract_Locator.texi @include ../../build/contract_Locator.texi
@item Example implementation
@subsubsection Example implementation
@uref{git://holbrook.no/eth-event-msg.git} @uref{git://holbrook.no/eth-event-msg.git}
@end table
@subsubsection Expressing locators in terms of numetic token id @subsubsection Expressing locators in terms of numeric token id
Given the numeric token id @code{1234567890987654321} (@code{0x112210f4b16c1cb1} hex), and a base url @code{https://contentgateway.grassecon.net}, the result of the methods may be as follows: Given the numeric token id @code{1234567890987654321} (@code{0x112210f4b16c1cb1} hex), and a base url @code{https://contentgateway.grassecon.net}, the result of the methods may be as follows:

View File

@ -4,11 +4,14 @@ Attached to @code{ERC20} and @code{ERC721} tokens that may be minted.
Implements the @code{mint(...)} and @code{safeMint(...)} parts of @code{ERC5679} for interoperability. Implements the @code{mint(...)} and @code{safeMint(...)} parts of @code{ERC5679} for interoperability.
@table @dfn @subsubsection ERC165 Interface identifier
@item ERC165 Interface identifier
@include ../../build/Minter.interface @include ../../build/Minter.interface
@item Solidity interface definition
@subsubsection Solidity interface definition
@include ../../build/contract_Minter.texi @include ../../build/contract_Minter.texi
@item Example implementation
@subsubsection Example implementation
@uref{https://git.grassecon.net/cicnet/erc20-demurrage-token.git} @uref{https://git.grassecon.net/cicnet/erc20-demurrage-token.git}
@end table

View File

@ -7,11 +7,14 @@ The reference may or may not be mutable.
The interface complements @code{Locator} and @code{MultiHash} to generate locators for how to resolve the reference. The interface complements @code{Locator} and @code{MultiHash} to generate locators for how to resolve the reference.
@table @dfn @subsubsection ERC165 Interface identifier
@item ERC165 Interface identifier
@include ../../build/Msg.interface @include ../../build/Msg.interface
@item Solidity interface definition
@subsubsection Solidity interface definition
@include ../../build/contract_Msg.texi @include ../../build/contract_Msg.texi
@item Example implementation
@subsubsection Example implementation
@uref{git://holbrook.no/eth-event-msg.git} @uref{git://holbrook.no/eth-event-msg.git}
@end table

View File

@ -11,13 +11,18 @@ Entry-point to discover all relevant contracts of CIC networks.
Unique (ERC20) token symbol resolver. Unique (ERC20) token symbol resolver.
@end enumerate @end enumerate
@table @dfn @subsubsection ERC165 Interface identifier
@item ERC165 Interface identifier
@include ../../build/RegistryClient.interface @include ../../build/RegistryClient.interface
@item Solidity interface definition
@subsubsection Solidity interface definition
@include ../../build/contract_RegistryClient.texi @include ../../build/contract_RegistryClient.texi
@item Contract registry implementation
@subsubsection Contract registry implementation
@uref{git://holbrook.no/eth-contract-registry.git,} @uref{git://holbrook.no/eth-contract-registry.git,}
@item Token index implementation
@subsubsection Token index implementation
@uref{git://holbrook.no/eth-contract-registry.git,} @uref{git://holbrook.no/eth-contract-registry.git,}
@end table

View File

@ -21,11 +21,14 @@ Allow ownership of a contract to be transferred
The expiry time of a token (see @code{Expire}) The expiry time of a token (see @code{Expire})
@end itemize @end itemize
@table @dfn @subsubsection ERC165 Interface identifier
@item ERC165 Interface identifier
@include ../../build/Seal.interface @include ../../build/Seal.interface
@item Solidity interface definition
@subsubsection Solidity interface definition
@include ../../build/contract_Seal.texi @include ../../build/contract_Seal.texi
@item Example implementation
@subsubsection Example implementation
@uref{https://git.grassecon.net/cicnet/erc20-demurrage-token.git} @uref{https://git.grassecon.net/cicnet/erc20-demurrage-token.git}
@end table

View File

@ -6,14 +6,17 @@ It allows defining the granularity of the rate of change, aswell as a frequency
A method for canonical value change calculations is also provided. A method for canonical value change calculations is also provided.
@table @dfn @subsubsection ERC165 Interface identifier
@item ERC165 Interface identifier
@include ../../build/TokenRateChange.interface @include ../../build/TokenRateChange.interface
@item Solidity interface definition
@subsubsection Solidity interface definition
@include ../../build/contract_TokenRateChange.texi @include ../../build/contract_TokenRateChange.texi
@item Reference implementations
@subsubsection Reference implementations
@itemize @itemize
@item @item
@uref{git://holbrook.no/erc20-demurrage-token.git,} @uref{git://holbrook.no/erc20-demurrage-token.git,}
@end itemize @end itemize
@end table

View File

@ -2,14 +2,17 @@
Token swap interface that can fit token escrow aswell as token swap contracts. Token swap interface that can fit token escrow aswell as token swap contracts.
@table @dfn @subsubsection ERC165 Interface identifier
@item ERC165 Interface identifier
@include ../../build/TokenSwap.interface @include ../../build/TokenSwap.interface
@item Solidity interface definition
@subsubsection Solidity interface definition
@include ../../build/contract_TokenSwap.texi @include ../../build/contract_TokenSwap.texi
@item Reference implementations
@subsubsection Reference implementations
@itemize @itemize
@item @item
@uref{git://holbrook.no/erc20-vend.git,} @uref{git://holbrook.no/erc20-vend.git,}
@end itemize @end itemize
@end table

View File

@ -10,14 +10,16 @@ Voted tokens @strong{SHOULD} be locked until the voting has finalized.
Finalization of voting should be callable by anyone. Finalization of voting should be callable by anyone.
@table @dfn @subsubsection ERC165 Interface identifier
@item ERC165 Interface identifier
@include ../../build/TokenVote.interface @include ../../build/TokenVote.interface
@item Solidity interface definition
@subsubsection Solidity interface definition
@include ../../build/contract_TokenVote.texi @include ../../build/contract_TokenVote.texi
@item Reference implementations
@subsubsection Reference implementations
@itemize @itemize
@item @item
@uref{git://holbrook.no/evm-tokenvote.git,} @uref{git://holbrook.no/evm-tokenvote.git,}
@end itemize @end itemize
@end table

View File

@ -19,11 +19,14 @@ Change the amount dispensed by the faucet.
Edit access control lists. Edit access control lists.
@end itemize @end itemize
@table @dfn @subsubsection ERC165 Interface identifier
@item ERC165 Interface identifier
@include ../../build/Writer.interface @include ../../build/Writer.interface
@item Solidity interface definition
@subsubsection Solidity interface definition
@include ../../build/contract_Writer.texi @include ../../build/contract_Writer.texi
@item Example implementation
@subsubsection Example implementation
@uref{https://git.grassecon.net/cicnet/erc20-demurrage-token.git} @uref{https://git.grassecon.net/cicnet/erc20-demurrage-token.git}
@end table

View File

@ -132,10 +132,12 @@ Attached to `ERC20` and `ERC721` tokens that may be *burned*.
Implements the `burn(...)` part of `ERC5679` for interoperability. Implements the `burn(...)` part of `ERC5679` for interoperability.
ERC165 Interface identifier #### ERC165 Interface identifier
b1110c1b b1110c1b
Solidity interface definition #### Solidity interface definition
interface IBurner { interface IBurner {
// Token(s) successfully burned; by who and how much. // Token(s) successfully burned; by who and how much.
event Burn(address indexed _burner, uint256 _burned); event Burn(address indexed _burner, uint256 _burned);
@ -158,7 +160,8 @@ Solidity interface definition
function totalMinted() external returns (uint256); function totalMinted() external returns (uint256);
} }
Example implementation #### Example implementation
<https://git.grassecon.net/cicnet/erc20-demurrage-token.git> <https://git.grassecon.net/cicnet/erc20-demurrage-token.git>
### Chrono ### Chrono
@ -167,17 +170,20 @@ Define a creation time for a resource.
Complements `ERC5007`. Complements `ERC5007`.
ERC165 Interface identifier #### ERC165 Interface identifier
4db1ccd4 4db1ccd4
Solidity interface definition #### Solidity interface definition
interface IChrono { interface IChrono {
// Returns the timestamp of when a resource corresponding to _idx was first created. // Returns the timestamp of when a resource corresponding to _idx was first created.
// int64 chosen as return value for simpler interoperability with ERC5007. // int64 chosen as return value for simpler interoperability with ERC5007.
function createTime(uint256 _idx) external returns(int64); function createTime(uint256 _idx) external returns(int64);
} }
Example implementation #### Example implementation
<https://git.defalsify.org/eth-erc721> (BadgeToken contract) <https://git.defalsify.org/eth-erc721> (BadgeToken contract)
### Declarator ### Declarator
@ -197,10 +203,12 @@ Any number of claims can be made about an address under any number of
topics. All claims must be stored, and returned in the order which they topics. All claims must be stored, and returned in the order which they
were added. were added.
ERC165 Interface identifier #### ERC165 Interface identifier
21b7493b 21b7493b
Solidity interface definition #### Solidity interface definition
interface IDeclarator { interface IDeclarator {
event DeclarationAdded(address indexed _declarator, address indexed _subject, bytes32 indexed _topic, bytes32 _proof); event DeclarationAdded(address indexed _declarator, address indexed _subject, bytes32 indexed _topic, bytes32 _proof);
@ -229,7 +237,8 @@ Solidity interface definition
function declaratorCount(address _subject) external view returns ( uint256 ); function declaratorCount(address _subject) external view returns ( uint256 );
} }
Reference implementation #### Reference implementation
<git://holbrook.no/eth-address-index.git> <git://holbrook.no/eth-address-index.git>
### Digest ### Digest
@ -242,10 +251,12 @@ Primary use-case is the abstraction of self-describing
A default encoding *must* always be defined, and the encoding of a valid A default encoding *must* always be defined, and the encoding of a valid
digest *must* succeed with the default encoding. digest *must* succeed with the default encoding.
ERC165 Interface identifier #### ERC165 Interface identifier
982ab05d 982ab05d
Solidity interface definition #### Solidity interface definition
interface IDigest { interface IDigest {
// Returns the default digest encoding used by the contract instance. // Returns the default digest encoding used by the contract instance.
function defaultDigestEncoding() external view returns (uint256 _encoding); function defaultDigestEncoding() external view returns (uint256 _encoding);
@ -264,7 +275,8 @@ Solidity interface definition
function encodeDigest(bytes memory _data) external view returns (bytes memory); function encodeDigest(bytes memory _data) external view returns (bytes memory);
} }
Example implementation #### Example implementation
<git://holbrook.no/eth-event-msg.git> <git://holbrook.no/eth-event-msg.git>
### Expire ### Expire
@ -275,10 +287,12 @@ change*.
A contract defining an expiry *must not* allow changing the expiration A contract defining an expiry *must not* allow changing the expiration
time to a time in the past. time to a time in the past.
ERC165 Interface identifier #### ERC165 Interface identifier
841a0e94 841a0e94
Solidity interface definition #### Solidity interface definition
interface IExpire { interface IExpire {
// Contract has expired. // Contract has expired.
event Expired(uint256 _timestamp); event Expired(uint256 _timestamp);
@ -297,7 +311,8 @@ Solidity interface definition
function applyExpiry() external returns(uint8); function applyExpiry() external returns(uint8);
} }
Example implementation #### Example implementation
<https://git.grassecon.net/cicnet/erc20-demurrage-token.git> <https://git.grassecon.net/cicnet/erc20-demurrage-token.git>
### Faucet ### Faucet
@ -332,10 +347,12 @@ amount to dispense.
The *check(address)* contract call *must* evaluate all four criteria, The *check(address)* contract call *must* evaluate all four criteria,
and *must* return `false` if any of the criteria are not met. and *must* return `false` if any of the criteria are not met.
ERC165 Interface identifier #### ERC165 Interface identifier
1a3ac634 1a3ac634
Solidity interface definition #### Solidity interface definition
interface IFaucet { interface IFaucet {
// Tokens were given to an address // Tokens were given to an address
event Give(address indexed _recipient, address indexed _token, uint256 _value); event Give(address indexed _recipient, address indexed _token, uint256 _value);
@ -370,7 +387,8 @@ Solidity interface definition
function nextBalance(address _recipient) external returns (uint256); function nextBalance(address _recipient) external returns (uint256);
} }
Reference implementations #### Reference implementations
- <git://holbrook.no/erc20-faucet.git> - <git://holbrook.no/erc20-faucet.git>
- <git://holbrook.no/eth-faucet.git> - <git://holbrook.no/eth-faucet.git>
@ -389,10 +407,12 @@ the content address.
Furthermore, it *should* be possible to refer to a resource by a Furthermore, it *should* be possible to refer to a resource by a
fully-qualified location on the web or an overlay network (e.g. tor). fully-qualified location on the web or an overlay network (e.g. tor).
ERC165 Interface identifier #### ERC165 Interface identifier
ed75b333 ed75b333
Solidity interface definition #### Solidity interface definition
interface ILocator { interface ILocator {
// URI that may or may not point to a specific resource location. // URI that may or may not point to a specific resource location.
function toURI(bytes memory _data) external view returns (string memory); function toURI(bytes memory _data) external view returns (string memory);
@ -401,10 +421,11 @@ Solidity interface definition
function toURL(bytes memory _data) external view returns(string memory); function toURL(bytes memory _data) external view returns(string memory);
} }
Example implementation #### Example implementation
<git://holbrook.no/eth-event-msg.git> <git://holbrook.no/eth-event-msg.git>
#### Expressing locators in terms of numetic token id #### Expressing locators in terms of numeric token id
Given the numeric token id `1234567890987654321` (`0x112210f4b16c1cb1` Given the numeric token id `1234567890987654321` (`0x112210f4b16c1cb1`
hex), and a base url `https://contentgateway.grassecon.net`, the result hex), and a base url `https://contentgateway.grassecon.net`, the result
@ -463,10 +484,12 @@ Attached to `ERC20` and `ERC721` tokens that may be minted.
Implements the `mint(...)` and `safeMint(...)` parts of `ERC5679` for Implements the `mint(...)` and `safeMint(...)` parts of `ERC5679` for
interoperability. interoperability.
ERC165 Interface identifier #### ERC165 Interface identifier
5878bcf4 5878bcf4
Solidity interface definition #### Solidity interface definition
interface IMinter { interface IMinter {
// Tokens are successfully minted; by who, to whom and how much // Tokens are successfully minted; by who, to whom and how much
event Mint(address indexed _minter, address indexed _beneficiary, uint256 value); event Mint(address indexed _minter, address indexed _beneficiary, uint256 value);
@ -484,7 +507,8 @@ Solidity interface definition
function safeMint(address _beneficiary, uint256 value, bytes calldata _data) external; function safeMint(address _beneficiary, uint256 value, bytes calldata _data) external;
} }
Example implementation #### Example implementation
<https://git.grassecon.net/cicnet/erc20-demurrage-token.git> <https://git.grassecon.net/cicnet/erc20-demurrage-token.git>
### Msg ### Msg
@ -497,10 +521,12 @@ The reference may or may not be mutable.
The interface complements `Locator` and `MultiHash` to generate locators The interface complements `Locator` and `MultiHash` to generate locators
for how to resolve the reference. for how to resolve the reference.
ERC165 Interface identifier #### ERC165 Interface identifier
a3002595 a3002595
Solidity interface definition #### Solidity interface definition
interface IMsg { interface IMsg {
// Emitted when a new message digest has been set // Emitted when a new message digest has been set
// Should not be emitted if the digest set is identical to the previous // Should not be emitted if the digest set is identical to the previous
@ -510,7 +536,8 @@ Solidity interface definition
function getMsg() external view returns(bytes memory); function getMsg() external view returns(bytes memory);
} }
Example implementation #### Example implementation
<git://holbrook.no/eth-event-msg.git> <git://holbrook.no/eth-event-msg.git>
### Registry ### Registry
@ -524,10 +551,12 @@ It currently has two distinct uses in the CIC context:
2. Unique (ERC20) token symbol resolver. 2. Unique (ERC20) token symbol resolver.
ERC165 Interface identifier #### ERC165 Interface identifier
effbf671 effbf671
Solidity interface definition #### Solidity interface definition
interface IRegistryClient { interface IRegistryClient {
// Address added to store with the given key // Address added to store with the given key
event AddressKey(bytes32 indexed _key, address _address); event AddressKey(bytes32 indexed _key, address _address);
@ -542,10 +571,12 @@ Solidity interface definition
function identifierCount() external view returns (uint256); function identifierCount() external view returns (uint256);
} }
Contract registry implementation #### Contract registry implementation
<git://holbrook.no/eth-contract-registry.git> <git://holbrook.no/eth-contract-registry.git>
Token index implementation #### Token index implementation
<git://holbrook.no/eth-contract-registry.git> <git://holbrook.no/eth-contract-registry.git>
### Seal ### Seal
@ -574,10 +605,12 @@ Use cases of sealing include:
- The expiry time of a token (see `Expire`) - The expiry time of a token (see `Expire`)
ERC165 Interface identifier #### ERC165 Interface identifier
0d7491f8 0d7491f8
Solidity interface definition #### Solidity interface definition
interface ISeal { interface ISeal {
// Seal state has changed. // Seal state has changed.
event SealStateChange(bool indexed _final, uint256 _sealState); event SealStateChange(bool indexed _final, uint256 _sealState);
@ -589,7 +622,8 @@ Solidity interface definition
function maxSealState() external view returns(uint256); function maxSealState() external view returns(uint256);
} }
Example implementation #### Example implementation
<https://git.grassecon.net/cicnet/erc20-demurrage-token.git> <https://git.grassecon.net/cicnet/erc20-demurrage-token.git>
### TokenRateChange ### TokenRateChange
@ -602,10 +636,12 @@ frequency for which the rate of change is applied.
A method for canonical value change calculations is also provided. A method for canonical value change calculations is also provided.
ERC165 Interface identifier #### ERC165 Interface identifier
b716af03 b716af03
Solidity interface definition #### Solidity interface definition
interface ITokenChangeRate { interface ITokenChangeRate {
// Time unit resolution for rate of change. // Time unit resolution for rate of change.
// A value of 0 indicates no rate of change, // A value of 0 indicates no rate of change,
@ -628,7 +664,8 @@ Solidity interface definition
function applyChange(int256 _value, uint256 _changeTimeUnits) external view returns(int256); function applyChange(int256 _value, uint256 _changeTimeUnits) external view returns(int256);
} }
Reference implementations #### Reference implementations
- <git://holbrook.no/erc20-demurrage-token.git> - <git://holbrook.no/erc20-demurrage-token.git>
### TokenSwap ### TokenSwap
@ -636,10 +673,12 @@ Reference implementations
Token swap interface that can fit token escrow aswell as token swap Token swap interface that can fit token escrow aswell as token swap
contracts. contracts.
ERC165 Interface identifier #### ERC165 Interface identifier
9e2d0236 9e2d0236
Solidity interface definition #### Solidity interface definition
interface ITokenSwap { interface ITokenSwap {
// Add inToken liquidity of the full balance of the sender // Add inToken liquidity of the full balance of the sender
// Requires token approval for the balance. // Requires token approval for the balance.
@ -660,7 +699,8 @@ Solidity interface definition
function withdraw(address _outToken, address _inToken, uint256 _value) external returns (uint256); function withdraw(address _outToken, address _inToken, uint256 _value) external returns (uint256);
} }
Reference implementations #### Reference implementations
- <git://holbrook.no/erc20-vend.git> - <git://holbrook.no/erc20-vend.git>
### TokenVote ### TokenVote
@ -675,10 +715,12 @@ Voted tokens **SHOULD** be locked until the voting has finalized.
Finalization of voting should be callable by anyone. Finalization of voting should be callable by anyone.
ERC165 Interface identifier #### ERC165 Interface identifier
f2e0bfeb f2e0bfeb
Solidity interface definition #### Solidity interface definition
interface ITokenVote { interface ITokenVote {
// A new proposal has been created. // A new proposal has been created.
@ -734,7 +776,8 @@ Solidity interface definition
function finalize() external returns (bool); function finalize() external returns (bool);
} }
Reference implementations #### Reference implementations
- <git://holbrook.no/evm-tokenvote.git> - <git://holbrook.no/evm-tokenvote.git>
### Writer ### Writer
@ -759,10 +802,12 @@ Some use-case examples of super-user actions include:
- Edit access control lists. - Edit access control lists.
ERC165 Interface identifier #### ERC165 Interface identifier
abe1f1f5 abe1f1f5
Solidity interface definition #### Solidity interface definition
interface IWriter { interface IWriter {
// A writer has been added by _executor // A writer has been added by _executor
event WriterAdded(address _writer); event WriterAdded(address _writer);
@ -780,5 +825,6 @@ Solidity interface definition
function isWriter(address _writer) external view returns (bool); function isWriter(address _writer) external view returns (bool);
} }
Example implementation #### Example implementation
<https://git.grassecon.net/cicnet/erc20-demurrage-token.git> <https://git.grassecon.net/cicnet/erc20-demurrage-token.git>

View File

@ -4,7 +4,9 @@ for f in $(ls solidity/*.sol); do
fn=$(basename $f) fn=$(basename $f)
fb=${fn%.*} fb=${fn%.*}
fn="build/contract_${fb}.texi" fn="build/contract_${fb}.texi"
echo "@verbatim" > $fn #echo "@verbatim" > $fn
echo -e "@example\n@verbatim" > $fn
awk 'f;/interface [a-zA-Z0-9]* /{print;f=1}' $f >> $fn awk 'f;/interface [a-zA-Z0-9]* /{print;f=1}' $f >> $fn
echo "@end verbatim" >> $fn #echo "@end verbatim" >> $fn
echo -e "@end verbatim\n@end example" >> $fn
done done