Skip to content

Commit

Permalink
Merge pull request EOSIO#12 from EOS-Mainnet/ricardian
Browse files Browse the repository at this point in the history
Add Ricardian Contracts
  • Loading branch information
DenisCarriere authored Jun 1, 2018
2 parents 93d4e48 + 50cf90c commit 9b90c4b
Show file tree
Hide file tree
Showing 38 changed files with 608 additions and 0 deletions.
15 changes: 15 additions & 0 deletions contracts/eosio.system/eosio.system-bidname-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Action - `{{ bidname }}`

### Description

The `{{ bidname }}` action places a bid on a premium account name, in the knowledge that the high bid will purchase the name.

### Inputs and Input Types

The `{{ bidname }}` action requires the following `inputs` and `input types`:

| Action | Input | Input Type |
|:--|:--|:--|
| `{{ bidname }}` | `{{ bidderVar }}`<br/>`{{ newnameVar }}`<br/>`{{ bidVar }}` | `{{ account_name }}`<br/>`{{ account_name }}`<br/>`{{ asset }}` |

As an authorized party I {{ signer }} wish to bid on behalf of {{ bidderVar }} the amount of {{ bidVar }} toward purchase of the account name {{ newnameVar }}.
16 changes: 16 additions & 0 deletions contracts/eosio.system/eosio.system-buyram-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Action - `{{ buyram }}`

### Description

This action will attempt to reserve about {{quant}} worth of RAM on behalf of {{receiver}}.

{{buyer}} authorizes this contract to transfer {{quant}} to buy RAM based upon the current price as determined by the market maker algorithm.

{{buyer}} accepts that a 0.5% fee will be charged on the amount spent and that the actual RAM received may be slightly less than expected due to the approximations necessary to enable this service.
{{buyer}} accepts that a 0.5% fee will be charged if and when they sell the RAM received.
{{buyer}} accepts that rounding errors resulting from limits of computational precision may result in less RAM being allocated.
{{buyer}} acknowledges that the supply of RAM may be increased at any time up to the limits of off-the-shelf computer equipment and that this may result in RAM selling for less than purchase price.
{{buyer}} acknowledges that the price of RAM may increase or decrease over time according to supply and demand.
{{buyer}} acknowledges that RAM is non-transferrable.
{{buyer}} acknowledges RAM currently in use by their account cannot be sold until it is freed and that freeing RAM may be subject to terms of other contracts.

16 changes: 16 additions & 0 deletions contracts/eosio.system/eosio.system-buyrambytes-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Action - `{{ buyrambytes }}`

### Description

This action will attempt to reserve about {{bytes}} bytes of RAM on behalf of {{receiver}}.

{{buyer}} authorizes this conrtact to transfer sufficient SYS tokens to buy the RAM based upon the current price as determined by the market maker algorithm.

{{buyer}} accepts that a 0.5% fee will be charged on the SYS spent and that the actual RAM received may be slightly less than requested due to the approximations necessary to enable this service.
{{buyer}} accepts that a 0.5% fee will be charged if and when they sell the RAM received.
{{buyer}} accepts that rounding errors resulting from limits of computational precision may result in less RAM being allocated.
{{buyer}} acknowledges that the supply of RAM may be increased at any time up to the limits of off-the-shelf computer equipment and that this may result in RAM selling for less than purchase price.
{{buyer}} acknowledges that the price of RAM may increase or decrease over time according to supply and demand.
{{buyer}} acknowledges that RAM is non-transferrable.
{{buyer}} acknowledges RAM currently in use by their account cannot be sold until it is freed and that freeing RAM may be subject to terms of other contracts.

15 changes: 15 additions & 0 deletions contracts/eosio.system/eosio.system-canceldelay-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Action - `{{ canceldelay }}`

### Description

The `{{ canceldelay }}` action cancels an existing delayed transaction.

### Inputs and Input Types

The `{{ canceldelay }}` action requires the following `inputs` and `input types`:

| Action | Input | Input Type |
|:--|:--|:--|
| `{{ canceldelay }}` | `{{ canceling_authVar }}`<br/>`{{ trx_idVar }}` | `{{ permission_level }}`<br/>`{{ transaction_id_type }}` |

As an authorized party I {{ signer }} wish to invoke the authority of {{ canceling_authVar }} to cancel the transaction with ID {{ trx_idVar }}.
15 changes: 15 additions & 0 deletions contracts/eosio.system/eosio.system-claimrewards-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Action - `{{ claimrewards }}`

### Description

The `{{ claimrewards }}` action allows a block producer (active or standby) to claim the system rewards due them for producing blocks and receiving votes.

### Input and Input Type

The `{{ claimrewards }}` action requires the following `input` and `input type`:

| Action | Input | Input Type |
|:--|:--|:--|
| `{{ claimrewards }}` | `{{ ownerVar }}` | `{{ account_name }}` |

As an authorized party I {{ signer }} wish to have the rewards earned by {{ ownerVar }} deposited into their (my) account.
58 changes: 58 additions & 0 deletions contracts/eosio.system/eosio.system-clause-constitution-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
This Constitution is a multi-party contract entered into by the Members by virtue of their use of this blockchain.

# Article I - No Initiation of Violence
Members shall not initiate violence or the threat of violence against another Member.

# Article II - No Perjury
Members shall be liable for losses caused by false or misleading attestations and shall forfeit any profit gained thereby.

# Article III - Rights
The Members grant the right of contract and of private property to each other, therefore no property shall change hands except with the consent of the owner, by a valid Arbitrator’s order, or via community referendum. This Constitution creates no positive rights for or between any Members.

# Article IV - No Vote Buying
No Member shall offer nor accept anything of value in exchange for a vote of any type, nor shall any Member unduly influence the vote of another.

# Article V - No Fiduciary
No Member nor SYS token holder shall have fiduciary responsibility to support the value of the SYS token. The Members do not authorize anyone to hold assets, borrow, nor contract on behalf of SYS token holders collectively. This blockchain has no owners, managers or fiduciaries; therefore, no Member shall have beneficial interest in more than 10% of the SYS token supply.

# Article VI - Restitution
Each Member agrees that penalties for breach of contract may include, but are not limited to, fines, loss of account, and other restitution.

# Article VII - Open Source
Each Member who makes available a smart contract on this blockchain shall be a Developer. Each Developer shall offer their smart contracts via a free and open source license, and each smart contract shall be documented with a Ricardian Contract stating the intent of all parties and naming the Arbitration Forum that will resolve disputes arising from that contract.

# Article VIII - Language
Multi-lingual contracts must specify one prevailing language in case of dispute and the author of any translation shall be liable for losses due to their false, misleading, or ambiguous attested translations.

# Article IX - Dispute Resolution
All disputes arising out of or in connection with this Constitution shall be finally settled under the Rules of Arbitration of the International Chamber of Commerce by one or more arbitrators appointed in accordance with the said Rules.

# Article X - Choice of Law
Choice of law for disputes shall be, in order of precedence, this Constitution and the Maxims of Equity.

# Article XI - Amending
This Constitution and its subordinate documents shall not be amended except by a vote of the token holders with no less than 15% vote participation among tokens and no fewer than 10% more Yes than No votes, sustained for 30 continuous days within a 120 day period.

# Article XII - Publishing
Members may only publish information to the Blockchain that is within their right to publish. Furthermore, Members voluntarily consent for all Members to permanently and irrevocably retain a copy, analyze, and distribute all broadcast transactions and derivative information.

# Article XIII - Informed Consent
All service providers who produce tools to facilitate the construction and signing of transactions on behalf of other Members shall present to said other Members the full Ricardian contract terms of this Constitution and other referenced contracts. Service providers shall be liable for losses resulting from failure to disclose the full Ricardian contract terms to users.

# Article XIV - Severability
If any part of this Constitution is declared unenforceable or invalid, the remainder will continue to be valid and enforceable.

# Article XV - Termination of Agreement
A Member is automatically released from all revocable obligations under this Constitution 3 years after the last transaction signed by that Member is incorporated into the blockchain. After 3 years of inactivity an account may be put up for auction and the proceeds distributed to all Members according to the system contract provisions then in effect for such redistribution.

# Article XVI - Developer Liability
Members agree to hold software developers harmless for unintentional mistakes made in the expression of contractual intent, whether or not said mistakes were due to actual or perceived negligence.

# Article XVII - Consideration
All rights and obligations under this Constitution are mutual and reciprocal and of equally significant value and cost to all parties.

# Article XVIII - Acceptance
A contract is deemed accepted when a member signs a transaction which incorporates a TAPOS proof of a block whose implied state incorporates an ABI of said contract and said transaction is incorporated into the blockchain.

# Article XIX - Counterparts
This Constitution may be executed in any number of counterparts, each of which when executed and delivered shall constitute a duplicate original, but all counterparts together shall constitute a single agreement.
6 changes: 6 additions & 0 deletions contracts/eosio.system/eosio.system-delband-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Action - `{{ delband }}`

### Description

This action will ...

20 changes: 20 additions & 0 deletions contracts/eosio.system/eosio.system-delegatebw-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# eosio.system delegatebw

## delegatebw
(account_name-from;
account_name-to;
asset-stake_net_quantity;
asset-stake_cpu_quantity;
bool:transfer)

_Intent: stake tokens for bandwidth and/or CPU and optionally transfer ownership_

As an authorized party I {{ signer }} wish to stake {{ asset-stake_cpu_quantity }} for CPU and {{ asset-stake_net_quantity }} for bandwidth from the liquid tokens of {{ account_name-from }} for the use of delegatee {{ account_name-to }}.

{{if bool:transfer }}

It is {{ bool:transfer }} that I wish these tokens to become immediately owned by the delegatee.

{{/if}}

As signer I stipulate that, if I am not the beneficial owner of these tokens, I have proof that I’ve been authorized to take this action by their beneficial owner(s).
15 changes: 15 additions & 0 deletions contracts/eosio.system/eosio.system-deleteauth-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Action - `{{ deleteauth }}`

### Description

The `{{ deleteauth }}` action...

### Inputs and Input Types

The `{{ deleteauth }}` action requires the following `inputs` and `input types`:

| Action | Input | Input Type |
|:--|:--|:--|
| `{{ deleteauth }}` | `{{ accountVar }}`<br/>`{{ permissionVar }}` | `{{ account_name }}`<br/>`{{ permission_name }}` |

As an authorized party I {{ signer }} wish to UNKNOWN
5 changes: 5 additions & 0 deletions contracts/eosio.system/eosio.system-global-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Action - `{{ global }}`

### Description

This action will ...
15 changes: 15 additions & 0 deletions contracts/eosio.system/eosio.system-linkauth-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Action - `{{ linkauth }}`

### Description

The `{{ linkauth }}` action...

### Inputs and Input Types

The `{{ linkauth }}` action requires the following `inputs` and `input types`:

| Action | Input | Input Type |
|:--|:--|:--|
| `{{ linkauth }}` | `{{ accountVar }}`<br/>`{{ codeVar }}`<br/>`{{ typeVar }}`<br/>`{{ requirementVar }}` | `{{ account_name }}`<br/>`{{ account_name }}`<br/>`{{ action_name }}`<br/>`{{ permission_name }}` |

As an authorized party I {{ signer }} wish to UNKNOWN
15 changes: 15 additions & 0 deletions contracts/eosio.system/eosio.system-newaccount-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Action - `{{ newaccount }}`

### Description

The `{{ newaccount }}` action creates a new account.

### Inputs and Input Types

The `{{ newaccount }}` action requires the following `inputs` and `input types`:

| Action | Input | Input Type |
|:--|:--|:--|
| `{{ newaccount }}` | `{{ creatorVar }}`<br/>`{{ nameVar }}`<br/>`{{ ownerVar }}`<br/>`{{ activeVar }}` | `{{ account_name }}`<br/>`{{ account_name }}`<br/>`{{ authority }}`<br/>`{{ authority }}` |

As an authorized party I {{ signer }} wish to exercise the authority of {{ creatorVar }} to create a new account on this system named {{ nameVar }} such that the new account's owner public key shall be {{ ownerVar }} and the active public key shall be {{ activeVar }}.
15 changes: 15 additions & 0 deletions contracts/eosio.system/eosio.system-onerror-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Action - `{{ onerror }}`

### Description

The `{{ onerror }}` action...

### Inputs and Input Types

The `{{ onerror }}` action requires the following `inputs` and `input types`:

| Action | Input | Input Type |
|:--|:--|:--|
| `{{ onerror }}` | `{{ sender_idVar }}`<br/>`{{ sent_trxVar }}` | `{{ uint128 }}`<br/>`{{ bytes }}` |

As an authorized party I {{ signer }} wish to UNKNOWN
5 changes: 5 additions & 0 deletions contracts/eosio.system/eosio.system-producers-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Action - `{{ producers }}`

### Description

This action will ...
5 changes: 5 additions & 0 deletions contracts/eosio.system/eosio.system-rammarket-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Action - `{{ rammarket }}`

### Description

This action will ...
41 changes: 41 additions & 0 deletions contracts/eosio.system/eosio.system-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Smart Contract - `{{ eosio.system }}`

This is an overview of the actions for the `{{ eosio.system }}` smart contract. This Contract is legally binding and can be used in the event of a dispute. Disputes shall be settled through the standard arbitration process established by EOS.IO.

### Description

The `{{ eosio.system }}` contract...

### Actions, Inputs and Input Types

The table below contains the `actions`, `inputs` and `input types` for the `{{ eosio.system }}` contract.

| Action | Input | Input Type |
|:--|:--|:--|
| `{{ newaccount }}` | `{{ creator }}`<br/>`{{ name }}`<br/>`{{ owner }}`<br/>`{{ active }}` | `{{ account_name }}`<br/>`{{ account_name }}`<br/>`{{ authority }}`<br/>`{{ authority }}` |
| `{{ setcode }}` | `{{ account }}`<br/>`{{ vmtype }}`<br/>`{{ vmversion }}`<br/>`{{ code }}` | `{{ account_name }}`<br/>`{{ uint8 }}`<br/>`{{ uint8 }}`<br/>`{{ bytes }}` |
| `{{ setabi }}` | `{{ account }}`<br/>`{{ abi }}` | `{{ account_name }}`<br/>`{{ bytes }}` |
| `{{ updateauth }}` | `{{ account }}`<br/>`{{ permission }}`<br/>`{{ parent }}`<br/>`{{ auth }}` | `{{ account_name }}`<br/>`{{ permission_name }}`<br/>`{{ permission_name }}`<br/>`{{ authority }}` |
| `{{ deleteauth }}` | `{{ account }}`<br/>`{{ permission }}` | `{{ account_name }}`<br/>`{{ permission_name }}` |
| `{{ linkauth }}` | `{{ account }}`<br/>`{{ code }}`<br/>`{{ type }}`<br/>`{{ requirement }}` | `{{ account_name }}`<br/>`{{ account_name }}`<br/>`{{ action_name }}`<br/>`{{ permission_name }}` |
| `{{ unlinkauth }}` | `{{ account }}`<br/>`{{ code }}`<br/>`{{ type }}` | `{{ account_name }}`<br/>`{{ account_name }}`<br/>`{{ action_name }}` |
| `{{ canceldelay }}` | `{{ canceling_auth }}`<br/>`{{ trx_id }}` | `{{ permission_level }}`<br/>`{{ transaction_id_type }}` |
| `{{ onerror }}` | `{{ sender_id }}`<br/>`{{ sent_trx }}` | `{{ uint128 }}`<br/>`{{ bytes }}` |
| `{{ buyrambytes }}` | `{{ payer }}`<br/>`{{ receiver }}`<br/>`{{ bytes }}` | `{{ account_name }}`<br/>`{{ account_name }}`<br/>`{{ uint32 }}` |
| `{{ buyram }}` | `{{ payer }}`<br/>`{{ receiver }}`<br/>`{{ quant }}` | `{{ account_name }}`<br/>`{{ account_name }}`<br/>`{{ asset }}` |
| `{{ sellram }}` | `{{ account }}`<br/>`{{ bytes }}` | `{{ account_name }}`<br/>`{{ uint64 }}` |
| `{{ delegatebw }}` | `{{ from }}`<br/>`{{ receiver }}`<br/>`{{ stake_net_quantity }}`<br/>`{{ stake_cpu_quantity }}`<br/>`{{ transfer }}` | `{{ account_name }}`<br/>`{{ account_name }}`<br/>`{{ asset }}`<br/>`{{ asset }}`<br/>`{{ bool }}` |
| `{{ undelegatebw }}` | `{{ from }}`<br/>`{{ receiver }}`<br/>`{{ unstake_net_quantity }}`<br/>`{{ unstake_cpu_quantity }}` | `{{ account_name }}`<br/>`{{ account_name }}`<br/>`{{ asset }}`<br/>`{{ asset }}` |
| `{{ refund }}` | `{{ owner }}` | `{{ account_name }}` |
| `{{ regproducer }}` | `{{ producer }}`<br/>`{{ producer_key }}`<br/>`{{ url }}`<br/>`{{ location }}` | `{{ account_name }}`<br/>`{{ public_key }}`<br/>`{{ string }}`<br/>`{{ uint16 }}` |
| `{{ setram }}` | `{{ max_ram_size }}` | `{{ uint64 }}` |
| `{{ bidname }}` | `{{ bidder }}`<br/>`{{ newname }}`<br/>`{{ bid }}` | `{{ account_name }}`<br/>`{{ account_name }}`<br/>`{{ asset }}` |
| `{{ unregprod }}` | `{{ producer }}` | `{{ account_name }}` |
| `{{ regproxy }}` | `{{ proxy }}`<br/>`{{ isproxy }}` | `{{ account_name }}`<br/>`{{ bool }}` |
| `{{ voteproducer }}` | `{{ voter }}`<br/>`{{ proxy }}`<br/>`{{ producers }}` | `{{ account_name }}`<br/>`{{ account_name }}`<br/>`{{ account_name[] }}` |
| `{{ claimrewards }}` | `{{ owner }}` | `{{ account_name }}` |
| `{{ setpriv }}` | `{{ account }}`<br/>`{{ is_priv }}` | `{{ account_name }}`<br/>`{{ int8 }}` |
| `{{ setalimits }}` | `{{ account }}`<br/>`{{ ram_bytes }}`<br/>`{{ net_weight }}`<br/>`{{ cpu_weight }}` | `{{ account_name }}`<br/>`{{ int64 }}`<br/>`{{ int64 }}`<br/>`{{ int64 }}` |
| `{{ setglimits }}` | `{{ cpu_usec_per_period }}` | `{{ int64 }}` |
| `{{ setprods }}` | `{{ schedule }}` | `{{ producer_key[] }}` |
| `{{ reqauth }}` | `{{ from }}` | `{{ account_name }}` |
16 changes: 16 additions & 0 deletions contracts/eosio.system/eosio.system-refund-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Action - `{{ refund }}`

### Description

The intent of the `{{ refund }}` action is to return previously unstaked tokens to an account after the unstaking period has elapsed.

### Input and Input Type

The `{{ refund }}` action requires the following `input` and `input type`:

| Action | Input | Input Type |
|:--|:--|:--|
| `{{ refund }}` | `{{ ownerVar }}` | `{{ account_name }}` |


As an authorized party I {{ signer }} wish to have the unstaked tokens of {{ ownerVar }} returned.
5 changes: 5 additions & 0 deletions contracts/eosio.system/eosio.system-refunds-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Action - `{{ refunds }}`

### Description

This action will ...
Loading

0 comments on commit 9b90c4b

Please sign in to comment.