Compare commits
No commits in common. "80671fdfaa0745e7a7c2855d32fd6a0ddaddc84c" and "a7cc6950452bbd80a58d178149a69191a4def552" have entirely different histories.
80671fdfaa
...
a7cc695045
52
README.md
52
README.md
@ -133,7 +133,7 @@ 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
|
bc4babdd
|
||||||
|
|
||||||
Solidity interface definition
|
Solidity interface definition
|
||||||
interface IBurner {
|
interface IBurner {
|
||||||
@ -144,11 +144,10 @@ Solidity interface definition
|
|||||||
function burn(address _from, uint256 _amount, bytes calldata _data) external;
|
function burn(address _from, uint256 _amount, bytes calldata _data) external;
|
||||||
|
|
||||||
// Burn given amount of tokens held by signer.
|
// Burn given amount of tokens held by signer.
|
||||||
function burn(uint256 _amount) external returns (bool);
|
function burn(uint256 _burn) external returns (bool);
|
||||||
|
|
||||||
// Burn all tokens held by signer.
|
// Burn all tokens held by signer.
|
||||||
// Returns the amount of tokens burned.
|
function burn() external returns (bool);
|
||||||
function burn() external returns (uint256);
|
|
||||||
|
|
||||||
// Total amount of tokens that have been burned.
|
// Total amount of tokens that have been burned.
|
||||||
function totalBurned() external returns (uint256);
|
function totalBurned() external returns (uint256);
|
||||||
@ -589,45 +588,6 @@ Solidity interface definition
|
|||||||
Example implementation
|
Example implementation
|
||||||
<https://git.grassecon.net/cicnet/erc20-demurrage-token.git>
|
<https://git.grassecon.net/cicnet/erc20-demurrage-token.git>
|
||||||
|
|
||||||
### TokenRateChange
|
|
||||||
|
|
||||||
Enables detection of properties for CIC tokens that change value over
|
|
||||||
time, e.g. through demurrage.
|
|
||||||
|
|
||||||
It allows defining the granularity of the rate of change, aswell as a
|
|
||||||
frequency for which the rate of change is applied.
|
|
||||||
|
|
||||||
A method for canonical value change calculations is also provided.
|
|
||||||
|
|
||||||
ERC165 Interface identifier
|
|
||||||
b716af03
|
|
||||||
|
|
||||||
Solidity interface definition
|
|
||||||
interface ITokenChangeRate {
|
|
||||||
// Time unit resolution for rate of change.
|
|
||||||
// A value of 0 indicates no rate of change,
|
|
||||||
function changeTimeUnit() external view returns(uint256);
|
|
||||||
|
|
||||||
// Rate of change per changeTimeUnit(), signed integer.
|
|
||||||
// An effective value of 0 indicates no rate of change.
|
|
||||||
function changeRate() external view returns (int256);
|
|
||||||
|
|
||||||
// Number of decimals with which the changeRate is defined.
|
|
||||||
// changeRate() should be divided by 10 ** changeRateDecimals() to obtain effective value
|
|
||||||
function changeRateDecimals() external view returns(uint8);
|
|
||||||
|
|
||||||
// Timestamp from when rate of change should be applied.
|
|
||||||
// A value of 0 indicates no rate of change,
|
|
||||||
function changeStartTime() external view returns(uint256);
|
|
||||||
|
|
||||||
// Calculate value with change rate applied for given amount of time units.
|
|
||||||
// Will calculate compounded change over the given amount of time units
|
|
||||||
function applyChange(int256 _value, uint256 _changeTimeUnits) external view returns(int256);
|
|
||||||
}
|
|
||||||
|
|
||||||
Reference implementations
|
|
||||||
- <git://holbrook.no/erc20-demurrage-token.git>
|
|
||||||
|
|
||||||
### TokenVend
|
### TokenVend
|
||||||
|
|
||||||
This interface defines the mechanism for which a specific ERC20 token
|
This interface defines the mechanism for which a specific ERC20 token
|
||||||
@ -673,7 +633,7 @@ 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
|
28091366
|
||||||
|
|
||||||
Solidity interface definition
|
Solidity interface definition
|
||||||
interface ITokenVote {
|
interface ITokenVote {
|
||||||
@ -695,8 +655,8 @@ Solidity interface definition
|
|||||||
// * _blockWait blocks from now.
|
// * _blockWait blocks from now.
|
||||||
function propose(bytes32 _description, uint256 _blockWait, uint24 _targetVotePpm) external returns (uint256);
|
function propose(bytes32 _description, uint256 _blockWait, uint24 _targetVotePpm) external returns (uint256);
|
||||||
|
|
||||||
// Add a voting option to a proposal
|
// Same as propose(...), but provide options to vote on.
|
||||||
function addOption(uint256 _proposalIdx, bytes32 _description) external;
|
function proposeMulti(bytes32 _description, bytes32[] memory _options, uint256 _blockWait, uint24 _targetVotePpm) external returns (uint256);
|
||||||
|
|
||||||
// Get number of options available for the proposal.
|
// Get number of options available for the proposal.
|
||||||
// This decides the boundary of the index that can be used with voteOptions(...)
|
// This decides the boundary of the index that can be used with voteOptions(...)
|
||||||
|
|||||||
@ -74,8 +74,6 @@ The following well-known solidity interfaces are partially implemented in CIC na
|
|||||||
|
|
||||||
@include seal.sol.texi
|
@include seal.sol.texi
|
||||||
|
|
||||||
@include tokenratechange.sol.texi
|
|
||||||
|
|
||||||
@include tokenvend.sol.texi
|
@include tokenvend.sol.texi
|
||||||
|
|
||||||
@include tokenvote.sol.texi
|
@include tokenvote.sol.texi
|
||||||
|
|||||||
@ -1,19 +0,0 @@
|
|||||||
@subsection TokenRateChange
|
|
||||||
|
|
||||||
Enables detection of properties for CIC tokens that change value over time, e.g. through demurrage.
|
|
||||||
|
|
||||||
It allows defining the granularity of the rate of change, aswell as a frequency for which the rate of change is applied.
|
|
||||||
|
|
||||||
A method for canonical value change calculations is also provided.
|
|
||||||
|
|
||||||
@table @dfn
|
|
||||||
@item ERC165 Interface identifier
|
|
||||||
@include ../../build/TokenRateChange.interface
|
|
||||||
@item Solidity interface definition
|
|
||||||
@include ../../build/contract_TokenRateChange.texi
|
|
||||||
@item Reference implementations
|
|
||||||
@itemize
|
|
||||||
@item
|
|
||||||
@uref{git://holbrook.no/erc20-demurrage-token.git,}
|
|
||||||
@end itemize
|
|
||||||
@end table
|
|
||||||
@ -133,7 +133,7 @@ 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
|
bc4babdd
|
||||||
|
|
||||||
Solidity interface definition
|
Solidity interface definition
|
||||||
interface IBurner {
|
interface IBurner {
|
||||||
@ -144,11 +144,10 @@ Solidity interface definition
|
|||||||
function burn(address _from, uint256 _amount, bytes calldata _data) external;
|
function burn(address _from, uint256 _amount, bytes calldata _data) external;
|
||||||
|
|
||||||
// Burn given amount of tokens held by signer.
|
// Burn given amount of tokens held by signer.
|
||||||
function burn(uint256 _amount) external returns (bool);
|
function burn(uint256 _burn) external returns (bool);
|
||||||
|
|
||||||
// Burn all tokens held by signer.
|
// Burn all tokens held by signer.
|
||||||
// Returns the amount of tokens burned.
|
function burn() external returns (bool);
|
||||||
function burn() external returns (uint256);
|
|
||||||
|
|
||||||
// Total amount of tokens that have been burned.
|
// Total amount of tokens that have been burned.
|
||||||
function totalBurned() external returns (uint256);
|
function totalBurned() external returns (uint256);
|
||||||
@ -589,45 +588,6 @@ Solidity interface definition
|
|||||||
Example implementation
|
Example implementation
|
||||||
<https://git.grassecon.net/cicnet/erc20-demurrage-token.git>
|
<https://git.grassecon.net/cicnet/erc20-demurrage-token.git>
|
||||||
|
|
||||||
### TokenRateChange
|
|
||||||
|
|
||||||
Enables detection of properties for CIC tokens that change value over
|
|
||||||
time, e.g. through demurrage.
|
|
||||||
|
|
||||||
It allows defining the granularity of the rate of change, aswell as a
|
|
||||||
frequency for which the rate of change is applied.
|
|
||||||
|
|
||||||
A method for canonical value change calculations is also provided.
|
|
||||||
|
|
||||||
ERC165 Interface identifier
|
|
||||||
b716af03
|
|
||||||
|
|
||||||
Solidity interface definition
|
|
||||||
interface ITokenChangeRate {
|
|
||||||
// Time unit resolution for rate of change.
|
|
||||||
// A value of 0 indicates no rate of change,
|
|
||||||
function changeTimeUnit() external view returns(uint256);
|
|
||||||
|
|
||||||
// Rate of change per changeTimeUnit(), signed integer.
|
|
||||||
// An effective value of 0 indicates no rate of change.
|
|
||||||
function changeRate() external view returns (int256);
|
|
||||||
|
|
||||||
// Number of decimals with which the changeRate is defined.
|
|
||||||
// changeRate() should be divided by 10 ** changeRateDecimals() to obtain effective value
|
|
||||||
function changeRateDecimals() external view returns(uint8);
|
|
||||||
|
|
||||||
// Timestamp from when rate of change should be applied.
|
|
||||||
// A value of 0 indicates no rate of change,
|
|
||||||
function changeStartTime() external view returns(uint256);
|
|
||||||
|
|
||||||
// Calculate value with change rate applied for given amount of time units.
|
|
||||||
// Will calculate compounded change over the given amount of time units
|
|
||||||
function applyChange(int256 _value, uint256 _changeTimeUnits) external view returns(int256);
|
|
||||||
}
|
|
||||||
|
|
||||||
Reference implementations
|
|
||||||
- <git://holbrook.no/erc20-demurrage-token.git>
|
|
||||||
|
|
||||||
### TokenVend
|
### TokenVend
|
||||||
|
|
||||||
This interface defines the mechanism for which a specific ERC20 token
|
This interface defines the mechanism for which a specific ERC20 token
|
||||||
@ -673,7 +633,7 @@ 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
|
28091366
|
||||||
|
|
||||||
Solidity interface definition
|
Solidity interface definition
|
||||||
interface ITokenVote {
|
interface ITokenVote {
|
||||||
@ -695,8 +655,8 @@ Solidity interface definition
|
|||||||
// * _blockWait blocks from now.
|
// * _blockWait blocks from now.
|
||||||
function propose(bytes32 _description, uint256 _blockWait, uint24 _targetVotePpm) external returns (uint256);
|
function propose(bytes32 _description, uint256 _blockWait, uint24 _targetVotePpm) external returns (uint256);
|
||||||
|
|
||||||
// Add a voting option to a proposal
|
// Same as propose(...), but provide options to vote on.
|
||||||
function addOption(uint256 _proposalIdx, bytes32 _description) external;
|
function proposeMulti(bytes32 _description, bytes32[] memory _options, uint256 _blockWait, uint24 _targetVotePpm) external returns (uint256);
|
||||||
|
|
||||||
// Get number of options available for the proposal.
|
// Get number of options available for the proposal.
|
||||||
// This decides the boundary of the index that can be used with voteOptions(...)
|
// This decides the boundary of the index that can be used with voteOptions(...)
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
safe-pysha3==1.0.4
|
pysha3==1.0.2
|
||||||
ply==3.11
|
ply==3.11
|
||||||
|
|||||||
@ -1,29 +0,0 @@
|
|||||||
pragma solidity >=0.6.12;
|
|
||||||
|
|
||||||
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
|
|
||||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
||||||
// File-version: 1
|
|
||||||
|
|
||||||
// Methods to detect tokens that are subject to continuous change, and
|
|
||||||
|
|
||||||
interface ITokenChangeRate {
|
|
||||||
// Time unit resolution for rate of change.
|
|
||||||
// A value of 0 indicates no rate of change,
|
|
||||||
function changeTimeUnit() external view returns(uint256);
|
|
||||||
|
|
||||||
// Rate of change per changeTimeUnit(), signed integer.
|
|
||||||
// An effective value of 0 indicates no rate of change.
|
|
||||||
function changeRate() external view returns (int256);
|
|
||||||
|
|
||||||
// Number of decimals with which the changeRate is defined.
|
|
||||||
// changeRate() should be divided by 10 ** changeRateDecimals() to obtain effective value
|
|
||||||
function changeRateDecimals() external view returns(uint8);
|
|
||||||
|
|
||||||
// Timestamp from when rate of change should be applied.
|
|
||||||
// A value of 0 indicates no rate of change,
|
|
||||||
function changeStartTime() external view returns(uint256);
|
|
||||||
|
|
||||||
// Calculate value with change rate applied for given amount of time units.
|
|
||||||
// Will calculate compounded change over the given amount of time units
|
|
||||||
function applyChange(int256 _value, uint256 _changeTimeUnits) external view returns(int256);
|
|
||||||
}
|
|
||||||
@ -2,7 +2,7 @@ pragma solidity >=0.6.12;
|
|||||||
|
|
||||||
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
|
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
|
||||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
// File-version: 2
|
// File-version: 1
|
||||||
|
|
||||||
|
|
||||||
interface ITokenVote {
|
interface ITokenVote {
|
||||||
@ -24,8 +24,8 @@ interface ITokenVote {
|
|||||||
// * _blockWait blocks from now.
|
// * _blockWait blocks from now.
|
||||||
function propose(bytes32 _description, uint256 _blockWait, uint24 _targetVotePpm) external returns (uint256);
|
function propose(bytes32 _description, uint256 _blockWait, uint24 _targetVotePpm) external returns (uint256);
|
||||||
|
|
||||||
// Add a voting option to a proposal
|
// Same as propose(...), but provide options to vote on.
|
||||||
function addOption(uint256 _proposalIdx, bytes32 _description) external;
|
function proposeMulti(bytes32 _description, bytes32[] memory _options, uint256 _blockWait, uint24 _targetVotePpm) external returns (uint256);
|
||||||
|
|
||||||
// Get number of options available for the proposal.
|
// Get number of options available for the proposal.
|
||||||
// This decides the boundary of the index that can be used with voteOptions(...)
|
// This decides the boundary of the index that can be used with voteOptions(...)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user