24 |
25 | ---
26 | spec_version: "0.2.0"
27 | title: Execute Proposed Transaction
28 | summary: '{{nowrap executer}} executes the {{nowrap proposal_name}} proposal'
29 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/multisig.png#4fb41d3cf02d0dd2d35a29308e93c2d826ec770d6bb520db668f530764be7153
30 | ---
31 |
32 | {{executer}} executes the {{proposal_name}} proposal submitted by {{proposer}} if the minimum required approvals for the proposal have been secured.
33 |
34 |
invalidate
35 |
36 | ---
37 | spec_version: "0.2.0"
38 | title: Invalidate All Approvals
39 | summary: '{{nowrap account}} invalidates approvals on outstanding proposals'
40 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/multisig.png#4fb41d3cf02d0dd2d35a29308e93c2d826ec770d6bb520db668f530764be7153
41 | ---
42 |
43 | {{account}} invalidates all approvals on proposals which have not yet executed.
44 |
45 |
propose
46 |
47 | ---
48 | spec_version: "0.2.0"
49 | title: Propose Transaction
50 | summary: '{{nowrap proposer}} creates the {{nowrap proposal_name}}'
51 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/multisig.png#4fb41d3cf02d0dd2d35a29308e93c2d826ec770d6bb520db668f530764be7153
52 | ---
53 |
54 | {{proposer}} creates the {{proposal_name}} proposal for the following transaction:
55 | {{to_json trx}}
56 |
57 | The proposal requests approvals from the following accounts at the specified permission levels:
58 | {{#each requested}}
59 | + {{this.permission}} permission of {{this.actor}}
60 | {{/each}}
61 |
62 | If the proposed transaction is not executed prior to {{trx.expiration}}, the proposal will automatically expire.
63 |
64 |
unapprove
65 |
66 | ---
67 | spec_version: "0.2.0"
68 | title: Unapprove Proposed Transaction
69 | summary: '{{nowrap level.actor}} revokes the approval previously provided to {{nowrap proposal_name}} proposal'
70 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/multisig.png#4fb41d3cf02d0dd2d35a29308e93c2d826ec770d6bb520db668f530764be7153
71 | ---
72 |
73 | {{level.actor}} revokes the approval previously provided at their {{level.permission}} permission level from the {{proposal_name}} proposal proposed by {{proposer}}.
74 |
--------------------------------------------------------------------------------
/docs/02_build-and-deploy.md:
--------------------------------------------------------------------------------
1 | ## How to build the eosio.contracts
2 |
3 | ### Preconditions
4 | Ensure an appropriate version of `eosio.cdt` is installed. Installing `eosio.cdt` from binaries is sufficient, follow the [`eosio.cdt` installation instructions steps](https://github.com/EOSIO/eosio.cdt/tree/master/#binary-releases) to install it. To verify if you have `eosio.cdt` installed and its version run the following command
5 |
6 | ```sh
7 | eosio-cpp -v
8 | ```
9 |
10 | #### Build contracts using the build script
11 |
12 | ##### To build contracts alone
13 | Run the `build.sh` script in the top directory to build all the contracts.
14 |
15 | ##### To build the contracts and unit tests
16 | 1. Ensure an appropriate version of `eosio` has been built from source and installed. Installing `eosio` from binaries `is not` sufficient. You can find instructions on how to do it [here](https://github.com/EOSIO/eos/blob/master/README.md) in section `Building from Sources`.
17 | 2. Run the `build.sh` script in the top directory with the `-t` flag to build all the contracts and the unit tests for these contracts.
18 |
19 | #### Build contracts manually
20 |
21 | To build the `eosio.contracts` execute the following commands.
22 |
23 | On all platforms except macOS:
24 | ```sh
25 | cd you_local_path_to/eosio.contracts/
26 | rm -fr build
27 | mkdir build
28 | cd build
29 | cmake ..
30 | make -j$( nproc )
31 | cd ..
32 | ```
33 |
34 | For macOS:
35 | ```sh
36 | cd you_local_path_to/eosio.contracts/
37 | rm -fr build
38 | mkdir build
39 | cd build
40 | cmake ..
41 | make -j$(sysctl -n hw.ncpu)
42 | cd ..
43 | ```
44 |
45 | #### After build:
46 | * If the build was configured to also build unit tests, the unit tests executable is placed in the _build/tests_ folder and is named __unit_test__.
47 | * The contracts (both `.wasm` and `.abi` files) are built into their corresponding _build/contracts/\_ folder.
48 | * Finally, simply use __cleos__ to _set contract_ by pointing to the previously mentioned directory for the specific contract.
49 |
50 | ## How to deploy the eosio.contracts
51 |
52 | ### To deploy eosio.bios contract execute the following command:
53 | Let's assume your account name to which you want to deploy the contract is `testerbios`
54 | ```
55 | cleos set contract testerbios you_local_path_to/eosio.contracts/build/contracts/eosio.bios/ -p testerbios
56 | ```
57 |
58 | ### To deploy eosio.msig contract execute the following command:
59 | Let's assume your account name to which you want to deploy the contract is `testermsig`
60 | ```
61 | cleos set contract testermsig you_local_path_to/eosio.contracts/build/contracts/eosio.msig/ -p testermsig
62 | ```
63 |
64 | ### To deploy eosio.system contract execute the following command:
65 | Let's assume your account name to which you want to deploy the contract is `testersystem`
66 | ```
67 | cleos set contract testersystem you_local_path_to/eosio.contracts/build/contracts/eosio.system/ -p testersystem
68 | ```
69 |
70 | ### To deploy eosio.token contract execute the following command:
71 | Let's assume your account name to which you want to deploy the contract is `testertoken`
72 | ```
73 | cleos set contract testertoken you_local_path_to/eosio.contracts/build/contracts/eosio.token/ -p testertoken
74 | ```
75 |
76 | ### To deploy eosio.wrap contract execute the following command:
77 | Let's assume your account name to which you want to deploy the contract is `testerwrap`
78 | ```
79 | cleos set contract testerwrap you_local_path_to/eosio.contracts/build/contracts/eosio.wrap/ -p testerwrap
80 | ```
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.5)
2 |
3 | project(eosio_contracts)
4 |
5 | set(VERSION_MAJOR 1)
6 | set(VERSION_MINOR 9)
7 | set(VERSION_PATCH 1)
8 | #set(VERSION_SUFFIX rc4)
9 |
10 | if (VERSION_SUFFIX)
11 | set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_SUFFIX}")
12 | else()
13 | set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
14 | endif()
15 |
16 | include(ExternalProject)
17 |
18 | find_package(eosio.cdt)
19 |
20 | message(STATUS "Building eosio.contracts v${VERSION_FULL}")
21 |
22 | set(EOSIO_CDT_VERSION_MIN "1.7")
23 | set(EOSIO_CDT_VERSION_SOFT_MAX "1.7")
24 | #set(EOSIO_CDT_VERSION_HARD_MAX "")
25 |
26 | ### Check the version of eosio.cdt
27 | set(VERSION_MATCH_ERROR_MSG "")
28 | EOSIO_CHECK_VERSION(VERSION_OUTPUT "${EOSIO_CDT_VERSION}"
29 | "${EOSIO_CDT_VERSION_MIN}"
30 | "${EOSIO_CDT_VERSION_SOFT_MAX}"
31 | "${EOSIO_CDT_VERSION_HARD_MAX}"
32 | VERSION_MATCH_ERROR_MSG)
33 | if(VERSION_OUTPUT STREQUAL "MATCH")
34 | message(STATUS "Using eosio.cdt version ${EOSIO_CDT_VERSION}")
35 | elseif(VERSION_OUTPUT STREQUAL "WARN")
36 | message(WARNING "Using eosio.cdt version ${EOSIO_CDT_VERSION} even though it exceeds the maximum supported version of ${EOSIO_CDT_VERSION_SOFT_MAX}; continuing with configuration, however build may fail.\nIt is recommended to use eosio.cdt version ${EOSIO_CDT_VERSION_SOFT_MAX}.x")
37 | else() # INVALID OR MISMATCH
38 | message(FATAL_ERROR "Found eosio.cdt version ${EOSIO_CDT_VERSION} but it does not satisfy version requirements: ${VERSION_MATCH_ERROR_MSG}\nPlease use eosio.cdt version ${EOSIO_CDT_VERSION_SOFT_MAX}.x")
39 | endif(VERSION_OUTPUT STREQUAL "MATCH")
40 |
41 | if(CMAKE_BUILD_TYPE STREQUAL "Debug")
42 | set(TEST_BUILD_TYPE "Debug")
43 | set(CMAKE_BUILD_TYPE "Release")
44 | else()
45 | set(TEST_BUILD_TYPE ${CMAKE_BUILD_TYPE})
46 | endif()
47 |
48 | ExternalProject_Add(
49 | contracts_project
50 | SOURCE_DIR ${CMAKE_SOURCE_DIR}/contracts
51 | BINARY_DIR ${CMAKE_BINARY_DIR}/contracts
52 | CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${EOSIO_CDT_ROOT}/lib/cmake/eosio.cdt/EosioWasmToolchain.cmake
53 | UPDATE_COMMAND ""
54 | PATCH_COMMAND ""
55 | TEST_COMMAND ""
56 | INSTALL_COMMAND ""
57 | BUILD_ALWAYS 1
58 | )
59 |
60 | if (APPLE)
61 | set(OPENSSL_ROOT "/usr/local/opt/openssl")
62 | elseif (UNIX)
63 | set(OPENSSL_ROOT "/usr/include/openssl")
64 | endif()
65 | set(SECP256K1_ROOT "/usr/local")
66 |
67 | if (APPLE)
68 | set(OPENSSL_ROOT "/usr/local/opt/openssl")
69 | elseif (UNIX)
70 | set(OPENSSL_ROOT "/usr/include/openssl")
71 | endif()
72 | set(SECP256K1_ROOT "/usr/local")
73 |
74 | string(REPLACE ";" "|" TEST_PREFIX_PATH "${CMAKE_PREFIX_PATH}")
75 | string(REPLACE ";" "|" TEST_FRAMEWORK_PATH "${CMAKE_FRAMEWORK_PATH}")
76 | string(REPLACE ";" "|" TEST_MODULE_PATH "${CMAKE_MODULE_PATH}")
77 |
78 | set(BUILD_TESTS FALSE CACHE BOOL "Build unit tests")
79 |
80 | if(BUILD_TESTS)
81 | message(STATUS "Building unit tests.")
82 | ExternalProject_Add(
83 | contracts_unit_tests
84 | LIST_SEPARATOR | # Use the alternate list separator
85 | CMAKE_ARGS -DCMAKE_BUILD_TYPE=${TEST_BUILD_TYPE} -DCMAKE_PREFIX_PATH=${TEST_PREFIX_PATH} -DCMAKE_FRAMEWORK_PATH=${TEST_FRAMEWORK_PATH} -DCMAKE_MODULE_PATH=${TEST_MODULE_PATH} -DEOSIO_ROOT=${EOSIO_ROOT} -DLLVM_DIR=${LLVM_DIR} -DBOOST_ROOT=${BOOST_ROOT}
86 | SOURCE_DIR ${CMAKE_SOURCE_DIR}/tests
87 | BINARY_DIR ${CMAKE_BINARY_DIR}/tests
88 | BUILD_ALWAYS 1
89 | TEST_COMMAND ""
90 | INSTALL_COMMAND ""
91 | )
92 | else()
93 | message(STATUS "Unit tests will not be built. To build unit tests, set BUILD_TESTS to true.")
94 | endif()
95 |
--------------------------------------------------------------------------------
/contracts/token.proton/src/token.proton.cpp:
--------------------------------------------------------------------------------
1 | /*##################################*\
2 | #
3 | #
4 | # Created by CryptoLions.io
5 | #
6 | #
7 | \*##################################*/
8 |
9 |
10 | #include
11 | #include
12 |
13 |
14 | namespace eosio {
15 |
16 |
17 | void tokenproton::reg(name tcontract, string tname, string url, string desc, string iconurl, symbol symbol){
18 |
19 | check( is_account( tcontract ), "tcontract account does not exist");
20 |
21 | check( tname.size() <= 16 , "max length for token name is 16.");
22 | check( url.size() <= 256 , "max length for url is 256.");
23 | check( iconurl.size() <= 256 , "max length for iconurl is 256.");
24 | check( desc.size() <= 512 , "max length for description is 512.");
25 |
26 | check( symbol.is_valid(), "invalid symbol name" );
27 |
28 | require_auth( tcontract );
29 | require_recipient( tcontract );
30 |
31 | tokens tokens_( get_self(), get_self().value );
32 |
33 | auto tcontract_index = tokens_.template get_index< "tcontract"_n >();
34 | for ( auto itro = tcontract_index.find( tcontract.value ); itro != tcontract_index.end(); itro++ ) {
35 | check( itro->symbol != symbol, "Token already registered");
36 | }
37 |
38 | auto newid = getid();
39 | tokens_.emplace( tcontract, [&]( auto& t ) {
40 | t.id = newid;
41 | t.tcontract = tcontract;
42 | t.tname = tname;
43 | t.url = url;
44 | t.desc = desc;
45 | t.iconurl = iconurl;
46 | t.symbol = symbol;
47 | t.blisted = false;
48 | });
49 | }
50 |
51 | void tokenproton::update(uint64_t id, name tcontract, string tname, string url, string desc, string iconurl, symbol symbol){
52 |
53 | check( is_account( tcontract ), "tcontract account does not exist");
54 |
55 | check( tname.size() <= 16 , "max length for token name is 16.");
56 | check( url.size() <= 256 , "max length for url is 256.");
57 | check( iconurl.size() <= 256 , "max length for iconurl is 256.");
58 | check( desc.size() <= 512 , "max length for description is 512.");
59 |
60 | check( symbol.is_valid(), "invalid symbol name" );
61 |
62 | tokens tokens_( get_self(), get_self().value );
63 | auto itr = tokens_.require_find( id, string("id: " + to_string( id ) + " cannot be found").c_str() );
64 |
65 | require_auth( tcontract );
66 | require_auth( itr->tcontract );
67 |
68 | require_recipient( tcontract );
69 |
70 | tokens_.modify( itr, tcontract, [&]( auto& t ) {
71 | t.tcontract = tcontract;
72 | t.tname = tname;
73 | t.url = url;
74 | t.desc = desc;
75 | t.iconurl = iconurl;
76 | t.symbol = symbol;
77 | });
78 | }
79 |
80 |
81 | void tokenproton::remove(uint64_t id){
82 |
83 | tokens tokens_( get_self(), get_self().value );
84 | auto itr = tokens_.require_find( id, string("id: " + to_string( id ) + " cannot be found").c_str() );
85 | require_auth( itr->tcontract );
86 |
87 | check (!(itr->blisted), "Blacklisted tokens cannot be removed.");
88 | tokens_.erase( itr );
89 | }
90 |
91 |
92 | void tokenproton::updblacklist(uint64_t id, bool blisted){
93 |
94 | require_auth( get_self() );
95 |
96 | tokens tokens_( get_self(), get_self().value );
97 | auto itr = tokens_.require_find( id, string("id: " + to_string( id ) + " cannot be found").c_str() );
98 |
99 | tokens_.modify( itr, get_self(), [&]( auto& t ) {
100 | t.blisted = blisted;
101 | });
102 |
103 | }
104 |
105 |
106 | uint64_t tokenproton::getid() {
107 | uint64_t resid;
108 |
109 | conf config( get_self(), get_self().value );
110 | _cstate = config.exists() ? config.get() : global{};
111 |
112 | _cstate.tid++;
113 | resid = _cstate.tid;
114 | config.set( _cstate, get_self() );
115 |
116 | return resid;
117 | }
118 | }
119 |
120 |
121 | EOSIO_DISPATCH( eosio::tokenproton, (reg)(update)(remove)(updblacklist))
--------------------------------------------------------------------------------
/contracts/eosio.token/ricardian/eosio.token.contracts.md.in:
--------------------------------------------------------------------------------
1 |
close
2 |
3 | ---
4 | spec_version: "0.2.0"
5 | title: Close Token Balance
6 | summary: 'Close {{nowrap owner}}’s zero quantity balance'
7 | icon: @ICON_BASE_URL@/@TOKEN_ICON_URI@
8 | ---
9 |
10 | {{owner}} agrees to close their zero quantity balance for the {{symbol_to_symbol_code symbol}} token.
11 |
12 | RAM will be refunded to the RAM payer of the {{symbol_to_symbol_code symbol}} token balance for {{owner}}.
13 |
14 |
create
15 |
16 | ---
17 | spec_version: "0.2.0"
18 | title: Create New Token
19 | summary: 'Create a new token'
20 | icon: @ICON_BASE_URL@/@TOKEN_ICON_URI@
21 | ---
22 |
23 | {{$action.account}} agrees to create a new token with symbol {{asset_to_symbol_code maximum_supply}} to be managed by {{issuer}}.
24 |
25 | This action will not result any any tokens being issued into circulation.
26 |
27 | {{issuer}} will be allowed to issue tokens into circulation, up to a maximum supply of {{maximum_supply}}.
28 |
29 | RAM will deducted from {{$action.account}}’s resources to create the necessary records.
30 |
31 |
issue
32 |
33 | ---
34 | spec_version: "0.2.0"
35 | title: Issue Tokens into Circulation
36 | summary: 'Issue {{nowrap quantity}} into circulation and transfer into {{nowrap to}}’s account'
37 | icon: @ICON_BASE_URL@/@TOKEN_ICON_URI@
38 | ---
39 |
40 | The token manager agrees to issue {{quantity}} into circulation, and transfer it into {{to}}’s account.
41 |
42 | {{#if memo}}There is a memo attached to the transfer stating:
43 | {{memo}}
44 | {{/if}}
45 |
46 | If {{to}} does not have a balance for {{asset_to_symbol_code quantity}}, or the token manager does not have a balance for {{asset_to_symbol_code quantity}}, the token manager will be designated as the RAM payer of the {{asset_to_symbol_code quantity}} token balance for {{to}}. As a result, RAM will be deducted from the token manager’s resources to create the necessary records.
47 |
48 | This action does not allow the total quantity to exceed the max allowed supply of the token.
49 |
50 |
open
51 |
52 | ---
53 | spec_version: "0.2.0"
54 | title: Open Token Balance
55 | summary: 'Open a zero quantity balance for {{nowrap owner}}'
56 | icon: @ICON_BASE_URL@/@TOKEN_ICON_URI@
57 | ---
58 |
59 | {{ram_payer}} agrees to establish a zero quantity balance for {{owner}} for the {{symbol_to_symbol_code symbol}} token.
60 |
61 | If {{owner}} does not have a balance for {{symbol_to_symbol_code symbol}}, {{ram_payer}} will be designated as the RAM payer of the {{symbol_to_symbol_code symbol}} token balance for {{owner}}. As a result, RAM will be deducted from {{ram_payer}}’s resources to create the necessary records.
62 |
63 |
retire
64 |
65 | ---
66 | spec_version: "0.2.0"
67 | title: Remove Tokens from Circulation
68 | summary: 'Remove {{nowrap quantity}} from circulation'
69 | icon: @ICON_BASE_URL@/@TOKEN_ICON_URI@
70 | ---
71 |
72 | The token manager agrees to remove {{quantity}} from circulation, taken from their own account.
73 |
74 | {{#if memo}} There is a memo attached to the action stating:
75 | {{memo}}
76 | {{/if}}
77 |
78 |
2 |
3 | ---
4 | spec_version: "0.2.0"
5 | title: Close Token Balance
6 | summary: 'Close {{nowrap owner}}’s zero quantity balance'
7 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/token.png#207ff68b0406eaa56618b08bda81d6a0954543f36adc328ab3065f31a5c5d654
8 | ---
9 |
10 | {{owner}} agrees to close their zero quantity balance for the {{symbol_to_symbol_code symbol}} token.
11 |
12 | RAM will be refunded to the RAM payer of the {{symbol_to_symbol_code symbol}} token balance for {{owner}}.
13 |
14 |
create
15 |
16 | ---
17 | spec_version: "0.2.0"
18 | title: Create New Token
19 | summary: 'Create a new token'
20 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/token.png#207ff68b0406eaa56618b08bda81d6a0954543f36adc328ab3065f31a5c5d654
21 | ---
22 |
23 | {{$action.account}} agrees to create a new token with symbol {{asset_to_symbol_code maximum_supply}} to be managed by {{issuer}}.
24 |
25 | This action will not result any any tokens being issued into circulation.
26 |
27 | {{issuer}} will be allowed to issue tokens into circulation, up to a maximum supply of {{maximum_supply}}.
28 |
29 | RAM will deducted from {{$action.account}}’s resources to create the necessary records.
30 |
31 |
issue
32 |
33 | ---
34 | spec_version: "0.2.0"
35 | title: Issue Tokens into Circulation
36 | summary: 'Issue {{nowrap quantity}} into circulation and transfer into {{nowrap to}}’s account'
37 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/token.png#207ff68b0406eaa56618b08bda81d6a0954543f36adc328ab3065f31a5c5d654
38 | ---
39 |
40 | The token manager agrees to issue {{quantity}} into circulation, and transfer it into {{to}}’s account.
41 |
42 | {{#if memo}}There is a memo attached to the transfer stating:
43 | {{memo}}
44 | {{/if}}
45 |
46 | If {{to}} does not have a balance for {{asset_to_symbol_code quantity}}, or the token manager does not have a balance for {{asset_to_symbol_code quantity}}, the token manager will be designated as the RAM payer of the {{asset_to_symbol_code quantity}} token balance for {{to}}. As a result, RAM will be deducted from the token manager’s resources to create the necessary records.
47 |
48 | This action does not allow the total quantity to exceed the max allowed supply of the token.
49 |
50 |
open
51 |
52 | ---
53 | spec_version: "0.2.0"
54 | title: Open Token Balance
55 | summary: 'Open a zero quantity balance for {{nowrap owner}}'
56 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/token.png#207ff68b0406eaa56618b08bda81d6a0954543f36adc328ab3065f31a5c5d654
57 | ---
58 |
59 | {{ram_payer}} agrees to establish a zero quantity balance for {{owner}} for the {{symbol_to_symbol_code symbol}} token.
60 |
61 | If {{owner}} does not have a balance for {{symbol_to_symbol_code symbol}}, {{ram_payer}} will be designated as the RAM payer of the {{symbol_to_symbol_code symbol}} token balance for {{owner}}. As a result, RAM will be deducted from {{ram_payer}}’s resources to create the necessary records.
62 |
63 |
retire
64 |
65 | ---
66 | spec_version: "0.2.0"
67 | title: Remove Tokens from Circulation
68 | summary: 'Remove {{nowrap quantity}} from circulation'
69 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/token.png#207ff68b0406eaa56618b08bda81d6a0954543f36adc328ab3065f31a5c5d654
70 | ---
71 |
72 | The token manager agrees to remove {{quantity}} from circulation, taken from their own account.
73 |
74 | {{#if memo}} There is a memo attached to the action stating:
75 | {{memo}}
76 | {{/if}}
77 |
78 |
203 |
204 | ---
205 | spec_version: "0.2.0"
206 | title: rmvkycprov
207 | summary: 'rmvkycprov'
208 | icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@
209 | ---
210 | Removes KYC provider {{kyc_provider}}
211 |
212 |
--------------------------------------------------------------------------------
/docs/03_guides/05_how-to-create-issue-and-transfer-a-token.md:
--------------------------------------------------------------------------------
1 | ## How to create, issue and transfer a token
2 |
3 | ## Step 1: Obtain Contract Source
4 |
5 | Navigate to your contracts directory.
6 |
7 | ```text
8 | cd CONTRACTS_DIR
9 | ```
10 |
11 | Pull the source
12 | ```text
13 | git clone https://github.com/EOSIO/eosio.contracts --branch master --single-branch
14 | ```
15 |
16 | ```text
17 | cd eosio.contracts/contracts/eosio.token
18 | ```
19 |
20 | ## Step 2: Create Account for Contract
21 | [[info]]
22 | | You may have to unlock your wallet first!
23 |
24 | ```shell
25 | cleos create account eosio eosio.token EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
26 | ```
27 |
28 | ## Step 3: Compile the Contract
29 |
30 | ```shell
31 | eosio-cpp -I include -o eosio.token.wasm src/eosio.token.cpp --abigen
32 | ```
33 |
34 | ## Step 4: Deploy the Token Contract
35 |
36 | ```shell
37 | cleos set contract eosio.token CONTRACTS_DIR/eosio.contracts/contracts/eosio.token --abi eosio.token.abi -p eosio.token@active
38 | ```
39 |
40 | Result should look similar to the one below:
41 | ```shell
42 | Reading WASM from ...
43 | Publishing contract...
44 | executed transaction: 69c68b1bd5d61a0cc146b11e89e11f02527f24e4b240731c4003ad1dc0c87c2c 9696 bytes 6290 us
45 | # eosio <= eosio::setcode {"account":"eosio.token","vmtype":0,"vmversion":0,"code":"0061736d0100000001aa011c60037f7e7f0060047f...
46 | # eosio <= eosio::setabi {"account":"eosio.token","abi":"0e656f73696f3a3a6162692f312e30000605636c6f73650002056f776e6572046e61...
47 | warning: transaction executed locally, but may not be confirmed by the network yet ]
48 | ```
49 |
50 | ## Step 5: Create the Token
51 |
52 | ```shell
53 | cleos push action eosio.token create '[ "eosio", "1000000000.0000 SYS"]' -p eosio.token@active
54 | ```
55 |
56 | Result should look similar to the one below:
57 | ```shell
58 | executed transaction: 0e49a421f6e75f4c5e09dd738a02d3f51bd18a0cf31894f68d335cd70d9c0e12 120 bytes 1000 cycles
59 | # eosio.token <= eosio.token::create {"issuer":"eosio","maximum_supply":"1000000000.0000 SYS"}
60 | ```
61 |
62 | An alternate approach uses named arguments:
63 |
64 | ```shell
65 | cleos push action eosio.token create '{"issuer":"eosio", "maximum_supply":"1000000000.0000 SYS"}' -p eosio.token@active
66 | ```
67 |
68 | Result should look similar to the one below:
69 | ```shell
70 | executed transaction: 0e49a421f6e75f4c5e09dd738a02d3f51bd18a0cf31894f68d335cd70d9c0e12 120 bytes 1000 cycles
71 | # eosio.token <= eosio.token::create {"issuer":"eosio","maximum_supply":"1000000000.0000 SYS"}
72 | ```
73 | This command created a new token `SYS` with a precision of 4 decimals and a maximum supply of 1000000000.0000 SYS. To create this token requires the permission of the `eosio.token` contract. For this reason, `-p eosio.token@active` was passed to authorize the request.
74 |
75 | ## Step 6: Issue Tokens
76 |
77 | The issuer can issue new tokens to the issuer account in our case `eosio`.
78 |
79 | ```text
80 | cleos push action eosio.token issue '[ "eosio", "100.0000 SYS", "memo" ]' -p eosio@active
81 | ```
82 |
83 | Result should look similar to the one below:
84 | ```shell
85 | executed transaction: a26b29d66044ad95edf0fc04bad3073e99718bc26d27f3c006589adedb717936 128 bytes 337 us
86 | # eosio.token <= eosio.token::issue {"to":"eosio","quantity":"100.0000 SYS","memo":"memo"}
87 | warning: transaction executed locally, but may not be confirmed by the network yet ]
88 | ```
89 |
90 | ## Step 7: Transfer Tokens
91 |
92 | Now that account `eosio` has been issued tokens, transfer some of them to account `bob`.
93 |
94 | ```shell
95 | cleos push action eosio.token transfer '[ "eosio", "bob", "25.0000 SYS", "m" ]' -p eosio@active
96 | ```
97 |
98 | Result should look similar to the one below:
99 | ```text
100 | executed transaction: 60d334850151cb95c35fe31ce2e8b536b51441c5fd4c3f2fea98edcc6d69f39d 128 bytes 497 us
101 | # eosio.token <= eosio.token::transfer {"from":"eosio","to":"bob","quantity":"25.0000 SYS","memo":"m"}
102 | # eosio <= eosio.token::transfer {"from":"eosio","to":"bob","quantity":"25.0000 SYS","memo":"m"}
103 | # bob <= eosio.token::transfer {"from":"eosio","to":"bob","quantity":"25.0000 SYS","memo":"m"}
104 | warning: transaction executed locally, but may not be confirmed by the network yet ]
105 | ```
106 | Now check if "bob" got the tokens using [cleos get currency balance](https://developers.eos.io/eosio-cleos/reference#currency-balance)
107 |
108 | ```shell
109 | cleos get currency balance eosio.token bob SYS
110 | ```
111 |
112 | Result:
113 | ```text
114 | 25.00 SYS
115 | ```
116 |
117 | Check "eosio's" balance, notice that tokens were deducted from the account
118 |
119 | ```shell
120 | cleos get currency balance eosio.token eosio SYS
121 | ```
122 |
123 | Result:
124 | ```text
125 | 75.00 SYS
126 | ```
127 |
--------------------------------------------------------------------------------
/contracts/eosio.proton/ricardian/eosio.proton.clauses.md:
--------------------------------------------------------------------------------
1 |
Warranty
2 | The invoker of the contract action shall uphold its Obligations under this Contract in a timely and workmanlike manner, using knowledge and recommendations for performing the services which meet generally acceptable standards set forth by EOS.IO Blockchain Block Producers.
3 |
4 |
Default
5 | The occurrence of any of the following shall constitute a material default under this Contract:
6 |
7 |
Remedies
8 | In addition to any and all other rights a party may have available according to law, if a party defaults by failing to substantially perform any provision, term or condition of this Contract, the other party may terminate the Contract by providing written notice to the defaulting party. This notice shall describe with sufficient detail the nature of the default. The party receiving such notice shall promptly be removed from being a Block Producer and this Contract shall be automatically terminated.
9 |
10 |
ForceMajeure
11 | If performance of this Contract or any obligation under this Contract is prevented, restricted, or interfered with by causes beyond either party's reasonable control ("Force Majeure"), and if the party unable to carry out its obligations gives the other party prompt written notice of such event, then the obligations of the party invoking this provision shall be suspended to the extent necessary by such event. The term Force Majeure shall include, without limitation, acts of God, fire, explosion, vandalism, storm or other similar occurrence, orders or acts of military or civil authority, or by national emergencies, insurrections, riots, or wars, or strikes, lock-outs, work stoppages, or supplier failures. The excused party shall use reasonable efforts under the circumstances to avoid or remove such causes of non-performance and shall proceed to perform with reasonable dispatch whenever such causes are removed or ceased. An act or omission shall be deemed within the reasonable control of a party if committed, omitted, or caused by such party, or its employees, officers, agents, or affiliates.
12 |
13 |
DisputeResolution
14 | Any controversies or disputes arising out of or relating to this Contract will be resolved by binding arbitration under the default rules set forth by the EOS.IO Blockchain. The arbitrator's award will be final, and judgment may be entered upon it by any court having proper jurisdiction.
15 |
16 |
EntireAgreement
17 | This Contract contains the entire agreement of the parties, and there are no other promises or conditions in any other agreement whether oral or written concerning the subject matter of this Contract. This Contract supersedes any prior written or oral agreements between the parties.
18 |
19 |
Severability
20 | If any provision of this Contract will be held to be invalid or unenforceable for any reason, the remaining provisions will continue to be valid and enforceable. If a court finds that any provision of this Contract is invalid or unenforceable, but that by limiting such provision it would become valid and enforceable, then such provision will be deemed to be written, construed, and enforced as so limited.
21 |
22 |
Amendment
23 | This Contract may be modified or amended in writing by mutual agreement between the parties, if the writing is signed by the party obligated under the amendment.
24 |
25 |
GoverningLaw
26 | This Contract shall be construed in accordance with the Maxims of Equity.
27 |
28 |
Notice
29 | Any notice or communication required or permitted under this Contract shall be sufficiently given if delivered to a verifiable email address or to such other email address as one party may have publicly furnished in writing, or published on a broadcast contract provided by this blockchain for purposes of providing notices of this type.
30 |
31 |
WaiverOfContractualRight
32 | The failure of either party to enforce any provision of this Contract shall not be construed as a waiver or limitation of that party's right to subsequently enforce and compel strict compliance with every provision of this Contract.
33 |
34 |
ArbitratorsFees_
35 | In any action arising hereunder or any separate action pertaining to the validity of this Agreement, both sides shall pay half the initial cost of arbitration, and the prevailing party shall be awarded reasonable arbitrator's fees and costs.
36 |
37 |
ConstructionAndInterpretation
38 | The rule requiring construction or interpretation against the drafter is waived. The document shall be deemed as if it were drafted by both parties in a mutual effort.
39 |
40 |
InWitnessWhereof
41 | In witness whereof, the parties hereto have caused this Agreement to be executed by themselves or their duly authorized representatives as of the date of execution, and authorized as proven by the cryptographic signature on the transaction that invokes this contract.
42 |
43 |
44 |
--------------------------------------------------------------------------------
/contracts/eosio.assert/src/eosio.assert.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | namespace assert_contract {
8 |
9 | using bytes = std::vector;
10 |
11 | bytes get_action_bytes() {
12 | bytes result(action_data_size());
13 | read_action_data(result.data(), result.size());
14 | return result;
15 | }
16 |
17 | struct[[eosio::contract("eosio.assert")]] asserter : eosio::contract {
18 | using contract::contract;
19 |
20 | manifests manifest_table{get_self(), get_self().value};
21 | manifests_id_index manifest_id_idx = manifest_table.get_index<"id"_n>();
22 | chains chain_table{get_self(), get_self().value};
23 | stored_chain_params chain = chain_table.get_or_default();
24 |
25 | [[eosio::action]] void setchain(ignore chain_id, ignore chain_name, ignore icon) {
26 | require_auth("eosio"_n);
27 | auto hash = eosio::sha256(_ds.pos(), _ds.remaining());
28 | _ds >> chain.chain_id;
29 | _ds >> chain.chain_name;
30 | _ds >> chain.icon;
31 | chain.hash = hash;
32 | chain_table.set(chain, get_self());
33 | };
34 |
35 | [[eosio::action("add.manifest")]] void add_manifest(
36 | ignore account, ignore domain, ignore appmeta,
37 | ignore> whitelist) {
38 | auto hash = eosio::sha256(_ds.pos(), _ds.remaining());
39 | auto stored = stored_manifest{
40 | .unique_id = chain.next_unique_id++,
41 | .id = hash,
42 | };
43 | _ds >> stored.account;
44 | _ds >> stored.domain;
45 | _ds >> stored.appmeta;
46 | _ds >> stored.whitelist;
47 |
48 | require_auth(stored.account);
49 | auto it = manifest_id_idx.find(stored.id_key());
50 | check(it == manifest_id_idx.end(), "manifest already present");
51 | manifest_table.emplace(stored.account, [&](auto& x) { x = stored; });
52 | chain_table.set(chain, get_self());
53 | };
54 |
55 | [[eosio::action("del.manifest")]] void del_manifest(checksum256 id) {
56 | auto it = manifest_id_idx.find(id);
57 | check(it != manifest_id_idx.end(), "manifest not found");
58 | require_auth(it->account);
59 | manifest_id_idx.erase(it);
60 | };
61 |
62 | bool in(contract_action action, const std::vector& actions) {
63 | return std::find(actions.begin(), actions.end(), action) != actions.end() || //
64 | std::find(actions.begin(), actions.end(), contract_action{action.contract, name{0}}) != actions.end() ||
65 | std::find(actions.begin(), actions.end(), contract_action{name{0}, action.action}) != actions.end() ||
66 | std::find(actions.begin(), actions.end(), contract_action{name{0}, name{0}}) != actions.end();
67 | }
68 |
69 | static std::string hash_to_str(const checksum256& hash) {
70 | static const char table[] = "0123456789abcdef";
71 | auto bytes = hash.extract_as_byte_array();
72 | std::string result;
73 | for (uint8_t byte : bytes) {
74 | result += table[byte >> 4];
75 | result += table[byte & 0xf];
76 | }
77 | return result;
78 | }
79 |
80 | [[eosio::action()]] void require(
81 | const checksum256& chain_params_hash, const checksum256& manifest_id, const vector& actions,
82 | const vector& abi_hashes) {
83 | if (!(chain_params_hash == chain.hash))
84 | check(
85 | false,
86 | ("chain hash is " + hash_to_str(chain.hash) + " but user expected " + hash_to_str(chain_params_hash))
87 | .c_str());
88 | auto it = manifest_id_idx.find(manifest_id);
89 | check(it != manifest_id_idx.end(), "manifest not found");
90 | std::vector contracts;
91 | for (auto& action : actions) {
92 | auto contract_it = std::lower_bound(contracts.begin(), contracts.end(), action.contract);
93 | if (contract_it == contracts.end() || *contract_it != action.contract)
94 | contracts.insert(contract_it, action.contract);
95 | if (!in(action, it->whitelist))
96 | check(
97 | false,
98 | (action.action.to_string() + "@" + action.contract.to_string() + " is not in whitelist").c_str());
99 | }
100 | abi_hash_table table{"eosio"_n, "eosio"_n.value};
101 | check(abi_hashes.size() == contracts.size(), "incorrect number of abi hashes");
102 | for (size_t i = 0; i < abi_hashes.size(); ++i) {
103 | auto it = table.find(contracts[i].value);
104 | checksum256 hash{};
105 | if (it != table.end())
106 | hash = it->hash;
107 | if (!(abi_hashes[i] == hash))
108 | check(
109 | false, (contracts[i].to_string() + " abi hash is " + hash_to_str(hash) + " but user expected " +
110 | hash_to_str(abi_hashes[i]))
111 | .c_str());
112 | }
113 | }
114 | };
115 |
116 | } // namespace assert_contract
117 |
--------------------------------------------------------------------------------
/scripts/helper.sh:
--------------------------------------------------------------------------------
1 | # Ensures passed in version values are supported.
2 | function check-version-numbers() {
3 | CHECK_VERSION_MAJOR=$1
4 | CHECK_VERSION_MINOR=$2
5 |
6 | if [[ $CHECK_VERSION_MAJOR -lt $EOSIO_MIN_VERSION_MAJOR ]]; then
7 | exit 1
8 | fi
9 | if [[ $CHECK_VERSION_MAJOR -gt $EOSIO_MAX_VERSION_MAJOR ]]; then
10 | exit 1
11 | fi
12 | if [[ $CHECK_VERSION_MAJOR -eq $EOSIO_MIN_VERSION_MAJOR ]]; then
13 | if [[ $CHECK_VERSION_MINOR -lt $EOSIO_MIN_VERSION_MINOR ]]; then
14 | exit 1
15 | fi
16 | fi
17 | if [[ $CHECK_VERSION_MAJOR -eq $EOSIO_MAX_VERSION_MAJOR ]]; then
18 | if [[ $CHECK_VERSION_MINOR -gt $EOSIO_MAX_VERSION_MINOR ]]; then
19 | exit 1
20 | fi
21 | fi
22 | exit 0
23 | }
24 |
25 |
26 | # Handles choosing which EOSIO directory to select when the default location is used.
27 | function default-eosio-directories() {
28 | REGEX='^[0-9]+([.][0-9]+)?$'
29 | ALL_EOSIO_SUBDIRS=()
30 | if [[ -d ${HOME}/eosio ]]; then
31 | ALL_EOSIO_SUBDIRS=($(ls ${HOME}/eosio | sort -V))
32 | fi
33 | for ITEM in "${ALL_EOSIO_SUBDIRS[@]}"; do
34 | if [[ "$ITEM" =~ $REGEX ]]; then
35 | DIR_MAJOR=$(echo $ITEM | cut -f1 -d '.')
36 | DIR_MINOR=$(echo $ITEM | cut -f2 -d '.')
37 | if $(check-version-numbers $DIR_MAJOR $DIR_MINOR); then
38 | PROMPT_EOSIO_DIRS+=($ITEM)
39 | fi
40 | fi
41 | done
42 | for ITEM in "${PROMPT_EOSIO_DIRS[@]}"; do
43 | if [[ "$ITEM" =~ $REGEX ]]; then
44 | EOSIO_VERSION=$ITEM
45 | fi
46 | done
47 | }
48 |
49 |
50 | # Prompts or sets default behavior for choosing EOSIO directory.
51 | function eosio-directory-prompt() {
52 | if [[ -z $EOSIO_DIR_PROMPT ]]; then
53 | default-eosio-directories;
54 | echo 'No EOSIO location was specified.'
55 | while true; do
56 | if [[ $NONINTERACTIVE != true ]]; then
57 | if [[ -z $EOSIO_VERSION ]]; then
58 | echo "No default EOSIO installations detected..."
59 | PROCEED=n
60 | else
61 | printf "Is EOSIO installed in the default location: $HOME/eosio/$EOSIO_VERSION (y/n)" && read -p " " PROCEED
62 | fi
63 | fi
64 | echo ""
65 | case $PROCEED in
66 | "" )
67 | echo "Is EOSIO installed in the default location?";;
68 | 0 | true | [Yy]* )
69 | break;;
70 | 1 | false | [Nn]* )
71 | if [[ $PROMPT_EOSIO_DIRS ]]; then
72 | echo "Found these compatible EOSIO versions in the default location."
73 | printf "$HOME/eosio/%s\n" "${PROMPT_EOSIO_DIRS[@]}"
74 | fi
75 | printf "Enter the installation location of EOSIO:" && read -e -p " " EOSIO_DIR_PROMPT;
76 | EOSIO_DIR_PROMPT="${EOSIO_DIR_PROMPT/#\~/$HOME}"
77 | break;;
78 | * )
79 | echo "Please type 'y' for yes or 'n' for no.";;
80 | esac
81 | done
82 | fi
83 | export EOSIO_INSTALL_DIR="${EOSIO_DIR_PROMPT:-${HOME}/eosio/${EOSIO_VERSION}}"
84 | }
85 |
86 |
87 | # Prompts or default behavior for choosing EOSIO.CDT directory.
88 | function cdt-directory-prompt() {
89 | if [[ -z $CDT_DIR_PROMPT ]]; then
90 | echo 'No EOSIO.CDT location was specified.'
91 | while true; do
92 | if [[ $NONINTERACTIVE != true ]]; then
93 | printf "Is EOSIO.CDT installed in the default location? /usr/local/eosio.cdt (y/n)" && read -p " " PROCEED
94 | fi
95 | echo ""
96 | case $PROCEED in
97 | "" )
98 | echo "Is EOSIO.CDT installed in the default location?";;
99 | 0 | true | [Yy]* )
100 | break;;
101 | 1 | false | [Nn]* )
102 | printf "Enter the installation location of EOSIO.CDT:" && read -e -p " " CDT_DIR_PROMPT;
103 | CDT_DIR_PROMPT="${CDT_DIR_PROMPT/#\~/$HOME}"
104 | break;;
105 | * )
106 | echo "Please type 'y' for yes or 'n' for no.";;
107 | esac
108 | done
109 | fi
110 | export CDT_INSTALL_DIR="${CDT_DIR_PROMPT:-/usr/local/eosio.cdt}"
111 | }
112 |
113 |
114 | # Ensures EOSIO is installed and compatible via version listed in tests/CMakeLists.txt.
115 | function nodeos-version-check() {
116 | INSTALLED_VERSION=$(echo $($EOSIO_INSTALL_DIR/bin/nodeos --version))
117 | INSTALLED_VERSION_MAJOR=$(echo $INSTALLED_VERSION | cut -f1 -d '.' | sed 's/v//g')
118 | INSTALLED_VERSION_MINOR=$(echo $INSTALLED_VERSION | cut -f2 -d '.' | sed 's/v//g')
119 |
120 | if [[ -z $INSTALLED_VERSION_MAJOR || -z $INSTALLED_VERSION_MINOR ]]; then
121 | echo "Could not determine EOSIO version. Exiting..."
122 | exit 1;
123 | fi
124 |
125 | if $(check-version-numbers $INSTALLED_VERSION_MAJOR $INSTALLED_VERSION_MINOR); then
126 | if [[ $INSTALLED_VERSION_MAJOR -gt $EOSIO_SOFT_MAX_MAJOR ]]; then
127 | echo "Detected EOSIO version is greater than recommended soft max: $EOSIO_SOFT_MAX_MAJOR.$EOSIO_SOFT_MAX_MINOR. Proceed with caution."
128 | fi
129 | if [[ $INSTALLED_VERSION_MAJOR -eq $EOSIO_SOFT_MAX_MAJOR && $INSTALLED_VERSION_MINOR -gt $EOSIO_SOFT_MAX_MINOR ]]; then
130 | echo "Detected EOSIO version is greater than recommended soft max: $EOSIO_SOFT_MAX_MAJOR.$EOSIO_SOFT_MAX_MINOR. Proceed with caution."
131 | fi
132 | else
133 | echo "Supported versions are: $EOSIO_MIN_VERSION_MAJOR.$EOSIO_MIN_VERSION_MINOR - $EOSIO_MAX_VERSION_MAJOR.$EOSIO_MAX_VERSION_MINOR"
134 | echo "Invalid EOSIO installation. Exiting..."
135 | exit 1;
136 | fi
137 | }
138 |
--------------------------------------------------------------------------------
/IMPORTANT.md:
--------------------------------------------------------------------------------
1 | # Important Notice
2 |
3 | We (block.one and its affiliates) make available EOSIO and other software, updates, patches and documentation (collectively, Software) on a voluntary basis as a member of the EOSIO community. A condition of you accessing any Software, websites, articles, media, publications, documents or other material (collectively, Material) is your acceptance of the terms of this important notice.
4 |
5 | ## Software
6 | We are not responsible for ensuring the overall performance of Software or any related applications. Any test results or performance figures are indicative and will not reflect performance under all conditions. Software may contain components that are open sourced and subject to their own licenses; you are responsible for ensuring your compliance with those licenses.
7 |
8 | We make no representation, warranty, guarantee or undertaking in respect of Software, whether expressed or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall we be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the Software or the use or other dealings in the Software.
9 |
10 | Wallets and related components are complex software that require the highest levels of security. If incorrectly built or used, they may compromise users’ private keys and digital assets. Wallet applications and related components should undergo thorough security evaluations before being used. Only experienced developers should work with such Software.
11 |
12 | Material is not made available to any person or entity that is the subject of sanctions administered or enforced by any country or government or otherwise designated on any list of prohibited or restricted parties (including but not limited to the lists maintained by the United Nations Security Council, the U.S. Government, the European Union or its Member States, or other applicable government authority) or organized or resident in a country or territory that is the subject of country-wide or territory-wide sanctions. You represent and warrant that neither you nor any party having a direct or indirect beneficial interest in you or on whose behalf you are acting as agent or nominee is such a person or entity and you will comply with all applicable import, re-import, sanctions, anti-boycott, export, and re-export control laws and regulations. If this is not accurate or you do not agree, then you must immediately cease accessing our Material and delete all copies of Software.
13 |
14 | Any person using or offering Software in connection with providing software, goods or services to third parties shall advise such third parties of this important notice, including all limitations, restrictions and exclusions of liability.
15 |
16 | ## Trademarks
17 | Block.one, EOSIO, EOS, the heptahedron and associated logos and related marks are our trademarks. Other trademarks referenced in Material are the property of their respective owners.
18 |
19 | ## Third parties
20 | Any reference in Material to any third party or third-party product, resource or service is not an endorsement or recommendation by Block.one. We are not responsible for, and disclaim any and all responsibility and liability for, your use of or reliance on any of these resources. Third-party resources may be updated, changed or terminated at any time, so information in Material may be out of date or inaccurate.
21 |
22 | ## Forward-looking statements
23 | Please note that in making statements expressing Block.one’s vision, we do not guarantee anything, and all aspects of our vision are subject to change at any time and in all respects at Block.one’s sole discretion, with or without notice. We call these “forward-looking statements”, which includes statements on our website and in other Material, other than statements of historical facts, such as statements regarding EOSIO’s development, expected performance, and future features, or our business strategy, plans, prospects, developments and objectives. These statements are only predictions and reflect Block.one’s current beliefs and expectations with respect to future events; they are based on assumptions and are subject to risk, uncertainties and change at any time.
24 |
25 | We operate in a rapidly changing environment and new risks emerge from time to time. Given these risks and uncertainties, you are cautioned not to rely on these forward-looking statements. Actual results, performance or events may differ materially from what is predicted in the forward-looking statements. Some of the factors that could cause actual results, performance or events to differ materially from the forward-looking statements include, without limitation: technical feasibility and barriers; market trends and volatility; continued availability of capital, financing and personnel; product acceptance; the commercial success of any new products or technologies; competition; government regulation and laws; and general economic, market or business conditions.
26 |
27 | All statements are valid only as of the date of first posting and Block.one is under no obligation to, and expressly disclaims any obligation to, update or alter any statements, whether as a result of new information, subsequent events or otherwise. Nothing in any Material constitutes technological, financial, investment, legal or other advice, either in general or with regard to any particular situation or implementation. Please consult with experts in appropriate areas before implementing or utilizing anything contained in Material.
28 |
--------------------------------------------------------------------------------
/contracts/eosio.system/ricardian/eosio.system.clauses.md:
--------------------------------------------------------------------------------
1 |
UserAgreement
2 |
3 | User agreement for the chain can go here.
4 |
5 |
BlockProducerAgreement
6 |
7 | I, {{producer}}, hereby nominate myself for consideration as an elected block producer.
8 |
9 | If {{producer}} is selected to produce blocks by the system contract, I will sign blocks with my registered block signing keys and I hereby attest that I will keep these keys secret and secure.
10 |
11 | If {{producer}} is unable to perform obligations under this contract I will resign my position using the unregprod action.
12 |
13 | I acknowledge that a block is 'objectively valid' if it conforms to the deterministic blockchain rules in force at the time of its creation, and is 'objectively invalid' if it fails to conform to those rules.
14 |
15 | {{producer}} hereby agrees to only use my registered block signing keys to sign messages under the following scenarios:
16 |
17 | * proposing an objectively valid block at the time appointed by the block scheduling algorithm;
18 | * pre-confirming a block produced by another producer in the schedule when I find said block objectively valid;
19 | * and, confirming a block for which {{producer}} has received pre-confirmation messages from more than two-thirds of the active block producers.
20 |
21 | I hereby accept liability for any and all provable damages that result from my:
22 |
23 | * signing two different block proposals with the same timestamp;
24 | * signing two different block proposals with the same block number;
25 | * signing any block proposal which builds off of an objectively invalid block;
26 | * signing a pre-confirmation for an objectively invalid block;
27 | * or, signing a confirmation for a block for which I do not possess pre-confirmation messages from more than two-thirds of the active block producers.
28 |
29 | I hereby agree that double-signing for a timestamp or block number in concert with two or more other block producers shall automatically be deemed malicious and cause {{producer}} to be subject to:
30 |
31 | * a fine equal to the past year of compensation received,
32 | * immediate disqualification from being a producer,
33 | * and/or other damages.
34 |
35 | An exception may be made if {{producer}} can demonstrate that the double-signing occurred due to a bug in the reference software; the burden of proof is on {{producer}}.
36 |
37 | I hereby agree not to interfere with the producer election process. I agree to process all producer election transactions that occur in blocks I create, to sign all objectively valid blocks I create that contain election transactions, and to sign all pre-confirmations and confirmations necessary to facilitate transfer of control to the next set of producers as determined by the system contract.
38 |
39 | I hereby acknowledge that more than two-thirds of the active block producers may vote to disqualify {{producer}} in the event {{producer}} is unable to produce blocks or is unable to be reached, according to criteria agreed to among block producers.
40 |
41 | If {{producer}} qualifies for and chooses to collect compensation due to votes received, {{producer}} will provide a public endpoint allowing at least 100 peers to maintain synchronization with the blockchain and/or submit transactions to be included. {{producer}} shall maintain at least one validating node with full state and signature checking and shall report any objectively invalid blocks produced by the active block producers. Reporting shall be via a method to be agreed to among block producers, said method and reports to be made public.
42 |
43 | The community agrees to allow {{producer}} to authenticate peers as necessary to prevent abuse and denial of service attacks; however, {{producer}} agrees not to discriminate against non-abusive peers.
44 |
45 | I agree to process transactions on a FIFO (first in, first out) best-effort basis and to honestly bill transactions for measured execution time.
46 |
47 | I {{producer}} agree not to manipulate the contents of blocks in order to derive profit from: the order in which transactions are included, or the hash of the block that is produced.
48 |
49 | I, {{producer}}, hereby agree to disclose and attest under penalty of perjury all ultimate beneficial owners of my business entity who own more than 10% and all direct shareholders.
50 |
51 | I, {{producer}}, hereby agree to cooperate with other block producers to carry out our respective and mutual obligations under this agreement, including but not limited to maintaining network stability and a valid blockchain.
52 |
53 | I, {{producer}}, agree to maintain a website hosted at {{url}} which contains up-to-date information on all disclosures required by this contract.
54 |
55 | I, {{producer}}, agree to set the location value of {{location}} such that {{producer}} is scheduled with minimal latency between my previous and next peer.
56 |
57 | I, {{producer}}, agree to maintain time synchronization within 10 ms of global atomic clock time, using a method agreed to among block producers.
58 |
59 | I, {{producer}}, agree not to produce blocks before my scheduled time unless I have received all blocks produced by the prior block producer.
60 |
61 | I, {{producer}}, agree not to publish blocks with timestamps more than 500ms in the future unless the prior block is more than 75% full by either NET or CPU bandwidth metrics.
62 |
63 | I, {{producer}}, agree not to set the RAM supply to more RAM than my nodes contain and to resign if I am unable to provide the RAM approved by more than two-thirds of active block producers, as shown in the system parameters.
64 |
--------------------------------------------------------------------------------
/scripts/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "requires": true,
3 | "lockfileVersion": 1,
4 | "dependencies": {
5 | "@bloks/constants": {
6 | "version": "22.0.86",
7 | "resolved": "https://registry.npmjs.org/@bloks/constants/-/constants-22.0.86.tgz",
8 | "integrity": "sha512-IkHWw/zqHRohdtyXWgDu7kVb/Vf7pV5cGQR5i5ZC20u6HZqG43GTl7X6uxNyqcu95MyurwMjEtXxnA22jChjaQ=="
9 | },
10 | "@proton/js": {
11 | "version": "22.0.86",
12 | "resolved": "https://registry.npmjs.org/@proton/js/-/js-22.0.86.tgz",
13 | "integrity": "sha512-DYAN98J+90SPnCl9+uvR98+HOXDZ9Mv4+VzV/cGsi4vj9kE7s8BVv3vcq21PqldRoxnqnKZVCaD6bEESZ50dvQ==",
14 | "requires": {
15 | "@bloks/constants": "^22.0.86",
16 | "bs58": "^4.0.1",
17 | "cross-fetch": "^3.1.4",
18 | "elliptic": "^6.5.4",
19 | "fast-text-encoding": "^1.0.3",
20 | "hash.js": "1.1.7",
21 | "pako": "2.0.3",
22 | "ripemd-ts": "0.0.2",
23 | "zod": "^1.11.13"
24 | }
25 | },
26 | "base-x": {
27 | "version": "3.0.8",
28 | "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz",
29 | "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==",
30 | "requires": {
31 | "safe-buffer": "^5.0.1"
32 | }
33 | },
34 | "bn.js": {
35 | "version": "4.12.0",
36 | "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
37 | "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA=="
38 | },
39 | "brorand": {
40 | "version": "1.1.0",
41 | "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
42 | "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8="
43 | },
44 | "bs58": {
45 | "version": "4.0.1",
46 | "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz",
47 | "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=",
48 | "requires": {
49 | "base-x": "^3.0.2"
50 | }
51 | },
52 | "cross-fetch": {
53 | "version": "3.1.4",
54 | "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz",
55 | "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==",
56 | "requires": {
57 | "node-fetch": "2.6.1"
58 | }
59 | },
60 | "elliptic": {
61 | "version": "6.5.4",
62 | "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",
63 | "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",
64 | "requires": {
65 | "bn.js": "^4.11.9",
66 | "brorand": "^1.1.0",
67 | "hash.js": "^1.0.0",
68 | "hmac-drbg": "^1.0.1",
69 | "inherits": "^2.0.4",
70 | "minimalistic-assert": "^1.0.1",
71 | "minimalistic-crypto-utils": "^1.0.1"
72 | }
73 | },
74 | "fast-text-encoding": {
75 | "version": "1.0.3",
76 | "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz",
77 | "integrity": "sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig=="
78 | },
79 | "hash.js": {
80 | "version": "1.1.7",
81 | "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz",
82 | "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==",
83 | "requires": {
84 | "inherits": "^2.0.3",
85 | "minimalistic-assert": "^1.0.1"
86 | }
87 | },
88 | "hmac-drbg": {
89 | "version": "1.0.1",
90 | "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
91 | "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=",
92 | "requires": {
93 | "hash.js": "^1.0.3",
94 | "minimalistic-assert": "^1.0.0",
95 | "minimalistic-crypto-utils": "^1.0.1"
96 | }
97 | },
98 | "inherits": {
99 | "version": "2.0.4",
100 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
101 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
102 | },
103 | "minimalistic-assert": {
104 | "version": "1.0.1",
105 | "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
106 | "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A=="
107 | },
108 | "minimalistic-crypto-utils": {
109 | "version": "1.0.1",
110 | "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz",
111 | "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo="
112 | },
113 | "node-fetch": {
114 | "version": "2.6.1",
115 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
116 | "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
117 | },
118 | "pako": {
119 | "version": "2.0.3",
120 | "resolved": "https://registry.npmjs.org/pako/-/pako-2.0.3.tgz",
121 | "integrity": "sha512-WjR1hOeg+kki3ZIOjaf4b5WVcay1jaliKSYiEaB1XzwhMQZJxRdQRv0V31EKBYlxb4T7SK3hjfc/jxyU64BoSw=="
122 | },
123 | "ripemd-ts": {
124 | "version": "0.0.2",
125 | "resolved": "https://registry.npmjs.org/ripemd-ts/-/ripemd-ts-0.0.2.tgz",
126 | "integrity": "sha512-2XZ9cVFtjpQ3z6LmN+Kylz518XcPKmKHzxEXUEPJfqi8vZs+0reY65YU9wzhzrPGtqHzH3ARGZNnGNASlPaWfw=="
127 | },
128 | "safe-buffer": {
129 | "version": "5.2.1",
130 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
131 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
132 | },
133 | "zod": {
134 | "version": "1.11.17",
135 | "resolved": "https://registry.npmjs.org/zod/-/zod-1.11.17.tgz",
136 | "integrity": "sha512-UzIwO92D0dSFwIRyyqAfRXICITLjF0IP8tRbEK/un7adirMssWZx8xF/1hZNE7t61knWZ+lhEuUvxlu2MO8qqA=="
137 | }
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/contracts/eosio.bios/ricardian/eosio.bios.contracts.md.in:
--------------------------------------------------------------------------------
1 |
35 |
36 | ---
37 | spec_version: "0.2.0"
38 | title: Link Action to Permission
39 | summary: '{{nowrap account}} sets the minimum required permission for the {{#if type}}{{nowrap type}} action of the{{/if}} {{nowrap code}} contract to {{nowrap requirement}}'
40 | icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@
41 | ---
42 |
43 | {{account}} sets the minimum required permission for the {{#if type}}{{type}} action of the{{/if}} {{code}} contract to {{requirement}}.
44 |
45 | {{#if type}}{{else}}Any links explicitly associated to specific actions of {{code}} will take precedence.{{/if}}
46 |
47 |
newaccount
48 |
49 | ---
50 | spec_version: "0.2.0"
51 | title: Create New Account
52 | summary: '{{nowrap creator}} creates a new account with the name {{nowrap name}}'
53 | icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@
54 | ---
55 |
56 | {{creator}} creates a new account with the name {{name}} and the following permissions:
57 |
58 | owner permission with authority:
59 | {{to_json owner}}
60 |
61 | active permission with authority:
62 | {{to_json active}}
63 |
64 |
reqactivated
65 |
66 | ---
67 | spec_version: "0.2.0"
68 | title: Assert Protocol Feature Activation
69 | summary: 'Assert that protocol feature {{nowrap feature_digest}} has been activated'
70 | icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@
71 | ---
72 |
73 | Assert that the protocol feature with a digest of {{feature_digest}} has been activated.
74 |
75 |
reqauth
76 |
77 | ---
78 | spec_version: "0.2.0"
79 | title: Assert Authorization
80 | summary: 'Assert that authorization by {{nowrap from}} is provided'
81 | icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@
82 | ---
83 |
84 | Assert that authorization by {{from}} is provided.
85 |
86 |
setabi
87 |
88 | ---
89 | spec_version: "0.2.0"
90 | title: Deploy Contract ABI
91 | summary: 'Deploy contract ABI on account {{nowrap account}}'
92 | icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@
93 | ---
94 |
95 | Deploy the ABI file associated with the contract on account {{account}}.
96 |
97 |
setalimits
98 |
99 | ---
100 | spec_version: "0.2.0"
101 | title: Adjust Resource Limits of Account
102 | summary: 'Adjust resource limits of account {{nowrap account}}'
103 | icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@
104 | ---
105 |
106 | {{$action.account}} updates {{account}}’s resource limits to have a RAM quota of {{ram_bytes}} bytes, a NET bandwidth quota of {{net_weight}} and a CPU bandwidth quota of {{cpu_weight}}.
107 |
108 |
120 |
121 | ---
122 | spec_version: "0.2.0"
123 | title: Set System Parameters
124 | summary: 'Set system parameters'
125 | icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@
126 | ---
127 |
128 | {{$action.account}} sets system parameters to:
129 | {{to_json params}}
130 |
131 |
setpriv
132 |
133 | ---
134 | spec_version: "0.2.0"
135 | title: Make an Account Privileged or Unprivileged
136 | summary: '{{#if is_priv}}Make {{nowrap account}} privileged{{else}}Remove privileged status of {{nowrap account}}{{/if}}'
137 | icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@
138 | ---
139 |
140 | {{#if is_priv}}
141 | {{$action.account}} makes {{account}} privileged.
142 | {{else}}
143 | {{$action.account}} removes privileged status of {{account}}.
144 | {{/if}}
145 |
146 |
setprods
147 |
148 | ---
149 | spec_version: "0.2.0"
150 | title: Set Block Producers
151 | summary: 'Set block producer schedule'
152 | icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@
153 | ---
154 |
155 | {{$action.account}} proposes a block producer schedule of:
156 | {{#each schedule}}
157 | 1. {{this.producer_name}}
158 | {{/each}}
159 |
160 | The block signing authorities of each of the producers in the above schedule are listed below:
161 | {{#each schedule}}
162 | ### {{this.producer_name}}
163 | {{to_json this.authority}}
164 | {{/each}}
165 |
166 |
unlinkauth
167 |
168 | ---
169 | spec_version: "0.2.0"
170 | title: Unlink Action from Permission
171 | summary: '{{nowrap account}} unsets the minimum required permission for the {{#if type}}{{nowrap type}} action of the{{/if}} {{nowrap code}} contract'
172 | icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@
173 | ---
174 |
175 | {{account}} removes the association between the {{#if type}}{{type}} action of the{{/if}} {{code}} contract and its minimum required permission.
176 |
177 | {{#if type}}{{else}}This will not remove any links explicitly associated to specific actions of {{code}}.{{/if}}
178 |
179 |
updateauth
180 |
181 | ---
182 | spec_version: "0.2.0"
183 | title: Modify Account Permission
184 | summary: 'Add or update the {{nowrap permission}} permission of {{nowrap account}}'
185 | icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@
186 | ---
187 |
188 | Modify, and create if necessary, the {{permission}} permission of {{account}} to have a parent permission of {{parent}} and the following authority:
189 | {{to_json auth}}
190 |
--------------------------------------------------------------------------------
/contracts/eosio.proton/test.sh:
--------------------------------------------------------------------------------
1 |
2 | ### Deploy
3 | #./cleos.sh set contract eosio.proton ./eosio.proton -p eosio.proton
4 |
5 |
6 | ### Admins actions ################
7 | #
8 | #ALL PERMISSIONS: ["createacc",1],["vote",1],["regprod",1],["regproxy",1],["setcontract",1],["namebids",1],["rex",1],["delegate",1],["undelegate",1],["sellram",1],["buyram",1]]
9 | #
10 | #./cleos.sh push action eosio.proton setperm '{"name": "cryptoloins", "perms": [["regprod",1]]}' -p eosio.proton@active
11 |
12 | #./cleos.sh push action eosio.proton setuserava '{"acc": "tester", "ava": "ava_base64"}' -p wlcm.proton@update
13 | #./cleos.sh push action eosio.proton setusername '{"acc": "tester", "name": "Bohdan CryptoLions"}' -p wlcm.proton@update
14 | #./cleos.sh push action eosio.proton userverify '{"acc": "tester", "verifier": "cryptoloins", "verified": 1}' -p admin.proton@verifier -p cryptolions
15 |
16 | #./cleos.sh push action eosio.proton remove '{"acc": "tester"}' -p wlcm.proton@update
17 |
18 | #./cleos.sh push action eosio.proton kickbp '{"producer": "tester"}' -p admin.proton@committee
19 |
20 |
21 | ### Users Actions ##################
22 | #
23 | #./cleos.sh push action eosio.proton reqperm '{"acc": "cryptolions", "permission": "namebids"}' -p cryptolions
24 |
25 | #./cleos.sh push action eosio.proton updateraccs '{"acc": "tester1", "raccs": ["taskly", "tasklybank", "tasklyother"]}' -p tester1
26 | #./cleos.sh push action eosio.proton updateaacts '{"acc": "tester1", "aacts": [["eosio.token","transfer"], ["taskly", "markcheck"], ["taskly", "removecheck"]]}' -p tester1
27 | #./cleos.sh push action eosio.proton updateac '{"acc": "tester1", "ac": [["eosio.token","XPR"], ["eosio.token","XYZ"], ["usdtoken","USD"]]}' -p tester1
28 |
29 |
30 | ## Committee KickBP Permissions ##################
31 | # ./cleos.sh push action eosio updateauth '{"account": "eosio", "permission": "committee", "parent": "active", "auth": { "threshold": 1, "keys": [], "waits": [], "accounts": [{ "weight": 1, "permission": {"actor": "admin.proton", "permission": "committee"} }] } } ' -p eosio
32 | # ./cleos.sh set action permission eosio eosio kickbp committee
33 | # ./cleos.sh set action permission eosio eosio.proton kickbp committee
34 | #
35 | # ./cleos.sh push action eosio kickbp '{"producer": "protonbpa"}' -p eosio@committee
36 |
37 |
38 | ## KYC logic ###############################
39 | #
40 | # - Add Permissions
41 | # ./cleos.sh set action permission admin.proton eosio.proton addkycprov committee -p admin.proton
42 | # ./cleos.sh set action permission admin.proton eosio.proton blkycprov committee -p admin.proton
43 | # ./cleos.sh set action permission admin.proton eosio.proton rmvkycprov committee -p admin.proton
44 |
45 |
46 | ## ADD KYC Provider
47 | #
48 | ##./cleos.sh push action eosio.proton addkycprov '{"kyc_provider": "test1", "desc": "My desc as KYC testT prov 1", "url": "protonchain.com", "iconurl": "https://www.protonchain.com/static/protonLogo@3x-f30ef900442eabc13be4f1bcf1ad6683.png", "name": "Super Tester"}' -p admin.proton@committee
49 | #./cleos.sh push action eosio.proton addkycprov '{"kyc_provider": "test1", "desc": "My desc as KYC testT prov 1", "url": "protonchain.com", "iconurl": "https://www.protonchain.com/static/protonLogo@3x-f30ef900442eabc13be4f1bcf1ad6683.png", "name": "Super Tester1"}' -p admin.proton@light
50 | #./cleos.sh push action eosio.proton addkycprov '{"kyc_provider": "test2", "desc": "My desc as KYC testT prov 2", "url": "protonchain.com", "iconurl": "https://www.protonchain.com/static/protonLogo@3x-f30ef900442eabc13be4f1bcf1ad6683.png", "name": "Super Tester2"}' -p admin.proton@light
51 | #./cleos.sh push action eosio.proton addkycprov '{"kyc_provider": "test3", "desc": "My desc as KYC testT prov 3", "url": "protonchain.com", "iconurl": "https://www.protonchain.com/static/protonLogo@3x-f30ef900442eabc13be4f1bcf1ad6683.png", "name": "Super Tester3"}' -p admin.proton@light
52 | #./cleos.sh push action eosio.proton addkycprov '{"kyc_provider": "test4", "desc": "My desc as KYC testT prov 4", "url": "protonchain.com", "iconurl": "https://www.protonchain.com/static/protonLogo@3x-f30ef900442eabc13be4f1bcf1ad6683.png", "name": "Super Tester4"}' -p admin.proton@light
53 | #./cleos.sh push action eosio.proton addkycprov '{"kyc_provider": "test5", "desc": "My desc as KYC testT prov 5", "url": "protonchain.com", "iconurl": "https://www.protonchain.com/static/protonLogo@3x-f30ef900442eabc13be4f1bcf1ad6683.png", "name": "Super Tester5"}' -p admin.proton@light
54 |
55 |
56 | ## BList KYC Provider
57 | #
58 | ##./cleos.sh push action eosio.proton blkycprov '{"kyc_provider": "tester", "state": true}' -p admin.proton@committee
59 | #./cleos.sh push action eosio.proton blkycprov '{"kyc_provider": "tester", "state": true}' -p admin.proton@light
60 | #./cleos.sh push action eosio.proton blkycprov '{"kyc_provider": "tester", "state": false}' -p admin.proton@light
61 |
62 |
63 | ## Remove KYC Provider
64 | #
65 | ##./cleos.sh push action eosio.proton rmvkycprov '{"kyc_provider": "tester"}' -p admin.proton@committee
66 | #./cleos.sh push action eosio.proton rmvkycprov '{"kyc_provider": "tester"}' -p admin.proton@light
67 |
68 |
69 | ## Add KYC
70 | #./cleos.sh push action eosio.proton addkyc '{"acc": "cryptolions", "kyc":{ "kyc_provider": "test1", "kyc_level": "level 1, some data", "kyc_date": 1602532882}}' -p test1
71 | #./cleos.sh push action eosio.proton addkyc '{"acc": "cryptolions", "kyc":{ "kyc_provider": "test2", "kyc_level": "level 2, some data", "kyc_date": 1602532882}}' -p test2
72 | #./cleos.sh push action eosio.proton addkyc '{"acc": "bohdan", "kyc":{ "kyc_provider": "test3", "kyc_level": "level 3, some data", "kyc_date": 1602532882}}' -p test3
73 | #./cleos.sh push action eosio.proton addkyc '{"acc": "bohdan", "kyc":{ "kyc_provider": "test4", "kyc_level": "level 4, some data", "kyc_date": 1602532882}}' -p test4
74 | #./cleos.sh push action eosio.proton addkyc '{"acc": "bohdan", "kyc":{ "kyc_provider": "test5", "kyc_level": "level 5, some data", "kyc_date": 1602532882}}' -p test5
75 |
76 | ## Update KYC
77 | #./cleos.sh push action eosio.proton updatekyc '{"acc": "bohdan", "kyc":{ "kyc_provider": "test3", "kyc_level": "level 333, some data", "kyc_date": 1602532882}}' -p test3
78 |
79 | ## Remove KYC
80 | #./cleos.sh push action eosio.proton removekyc '{"acc": "bohdan", "kyc_provider": "test5"}' -p test5
81 |
82 |
83 |
84 | ### Tables ################
85 | #
86 | #./cleos.sh get table eosio.proton eosio.proton usersinfo
87 | #./cleos.sh get table eosio.proton eosio.proton permissions
88 | #./cleos.sh get table eosio.proton eosio.proton kycproviders
89 |
90 |
91 | ####
92 |
93 |
--------------------------------------------------------------------------------
/contracts/eosio.token/src/eosio.token.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | namespace eosio {
4 |
5 | void token::create( const name& issuer,
6 | const asset& maximum_supply )
7 | {
8 | require_auth( get_self() );
9 |
10 | auto sym = maximum_supply.symbol;
11 | check( sym.is_valid(), "invalid symbol name" );
12 | check( maximum_supply.is_valid(), "invalid supply");
13 | //check( maximum_supply.amount > 0, "max-supply must be positive"); // PROTON
14 |
15 | stats statstable( get_self(), sym.code().raw() );
16 | auto existing = statstable.find( sym.code().raw() );
17 | check( existing == statstable.end(), "token with symbol already exists" );
18 |
19 | statstable.emplace( get_self(), [&]( auto& s ) {
20 | s.supply.symbol = maximum_supply.symbol;
21 | // s.max_supply = maximum_supply; // PROTON
22 | s.max_supply = asset{0, sym}; // PROTON
23 | s.issuer = issuer;
24 | });
25 | }
26 |
27 |
28 | void token::issue( const name& to, const asset& quantity, const string& memo )
29 | {
30 | auto sym = quantity.symbol;
31 | check( sym.is_valid(), "invalid symbol name" );
32 | check( memo.size() <= 256, "memo has more than 256 bytes" );
33 |
34 | stats statstable( get_self(), sym.code().raw() );
35 | auto existing = statstable.find( sym.code().raw() );
36 | check( existing != statstable.end(), "token with symbol does not exist, create token before issue" );
37 | const auto& st = *existing;
38 | check( to == st.issuer, "tokens can only be issued to issuer account" );
39 |
40 | require_auth( st.issuer );
41 | check( quantity.is_valid(), "invalid quantity" );
42 | check( quantity.amount > 0, "must issue positive quantity" );
43 |
44 | check( quantity.symbol == st.supply.symbol, "symbol precision mismatch" );
45 | //check( quantity.amount <= st.max_supply.amount - st.supply.amount, "quantity exceeds available supply"); // PROTON
46 | check( quantity.amount + st.supply.amount <= MAX_AMOUNT, "quantity exceeds available supply"); // PROTON
47 |
48 | statstable.modify( st, same_payer, [&]( auto& s ) {
49 | s.max_supply = asset{0, st.supply.symbol}; // PROTON
50 | s.supply += quantity;
51 | });
52 |
53 | add_balance( st.issuer, quantity, st.issuer );
54 | }
55 |
56 | void token::retire( const asset& quantity, const string& memo )
57 | {
58 | auto sym = quantity.symbol;
59 | check( sym.is_valid(), "invalid symbol name" );
60 | check( memo.size() <= 256, "memo has more than 256 bytes" );
61 |
62 | stats statstable( get_self(), sym.code().raw() );
63 | auto existing = statstable.find( sym.code().raw() );
64 | check( existing != statstable.end(), "token with symbol does not exist" );
65 | const auto& st = *existing;
66 |
67 | require_auth( st.issuer );
68 | check( quantity.is_valid(), "invalid quantity" );
69 | check( quantity.amount > 0, "must retire positive quantity" );
70 |
71 | check( quantity.symbol == st.supply.symbol, "symbol precision mismatch" );
72 |
73 | statstable.modify( st, same_payer, [&]( auto& s ) {
74 | s.supply -= quantity;
75 | });
76 |
77 | sub_balance( st.issuer, quantity );
78 | }
79 |
80 | void token::transfer( const name& from,
81 | const name& to,
82 | const asset& quantity,
83 | const string& memo )
84 | {
85 | check( from != to, "cannot transfer to self" );
86 | require_auth( from );
87 | check( is_account( to ), "to account does not exist");
88 | auto sym = quantity.symbol.code();
89 | stats statstable( get_self(), sym.raw() );
90 | const auto& st = statstable.get( sym.raw() );
91 |
92 | require_recipient( from );
93 | require_recipient( to );
94 |
95 | check( quantity.is_valid(), "invalid quantity" );
96 | check( quantity.amount > 0, "must transfer positive quantity" );
97 | check( quantity.symbol == st.supply.symbol, "symbol precision mismatch" );
98 | check( memo.size() <= 256, "memo has more than 256 bytes" );
99 |
100 | auto payer = has_auth( to ) ? to : from;
101 |
102 | sub_balance( from, quantity );
103 | add_balance( to, quantity, payer );
104 | }
105 |
106 | void token::sub_balance( const name& owner, const asset& value ) {
107 | accounts from_acnts( get_self(), owner.value );
108 |
109 | const auto& from = from_acnts.get( value.symbol.code().raw(), "no balance object found" );
110 | check( from.balance.amount >= value.amount, "overdrawn balance" );
111 |
112 | from_acnts.modify( from, owner, [&]( auto& a ) {
113 | a.balance -= value;
114 | });
115 | }
116 |
117 | void token::add_balance( const name& owner, const asset& value, const name& ram_payer )
118 | {
119 | accounts to_acnts( get_self(), owner.value );
120 | auto to = to_acnts.find( value.symbol.code().raw() );
121 | if( to == to_acnts.end() ) {
122 | to_acnts.emplace( ram_payer, [&]( auto& a ){
123 | a.balance = value;
124 | });
125 | } else {
126 | to_acnts.modify( to, same_payer, [&]( auto& a ) {
127 | a.balance += value;
128 | });
129 | }
130 | }
131 |
132 | void token::open( const name& owner, const symbol& symbol, const name& ram_payer )
133 | {
134 | require_auth( ram_payer );
135 |
136 | check( is_account( owner ), "owner account does not exist" );
137 |
138 | auto sym_code_raw = symbol.code().raw();
139 | stats statstable( get_self(), sym_code_raw );
140 | const auto& st = statstable.get( sym_code_raw, "symbol does not exist" );
141 | check( st.supply.symbol == symbol, "symbol precision mismatch" );
142 |
143 | accounts acnts( get_self(), owner.value );
144 | auto it = acnts.find( sym_code_raw );
145 | if( it == acnts.end() ) {
146 | acnts.emplace( ram_payer, [&]( auto& a ){
147 | a.balance = asset{0, symbol};
148 | });
149 | }
150 | }
151 |
152 | void token::close( const name& owner, const symbol& symbol )
153 | {
154 | require_auth( owner );
155 | accounts acnts( get_self(), owner.value );
156 | auto it = acnts.find( symbol.code().raw() );
157 | check( it != acnts.end(), "Balance row already deleted or never existed. Action won't have any effect." );
158 | check( it->balance.amount == 0, "Cannot close because the balance is not zero." );
159 | acnts.erase( it );
160 | }
161 |
162 | } /// namespace eosio
163 |
--------------------------------------------------------------------------------
/contracts/eosio.token/include/eosio.token/eosio.token.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | #include
7 |
8 | namespace eosiosystem {
9 | class system_contract;
10 | }
11 |
12 | namespace eosio {
13 |
14 | using std::string;
15 |
16 | /**
17 | * eosio.token contract defines the structures and actions that allow users to create, issue, and manage
18 | * tokens on EOSIO based blockchains.
19 | */
20 | class [[eosio::contract("eosio.token")]] token : public contract {
21 | public:
22 | using contract::contract;
23 | const int64_t MAX_AMOUNT = eosio::asset::max_amount;
24 | /**
25 | * Allows `issuer` account to create a token in supply of `maximum_supply`. If validation is successful a new entry in statstable for token symbol scope gets created.
26 | *
27 | * @param issuer - the account that creates the token,
28 | * @param maximum_supply - the maximum supply set for the token created.
29 | *
30 | * @pre Token symbol has to be valid,
31 | * @pre Token symbol must not be already created,
32 | * @pre maximum_supply has to be smaller than the maximum supply allowed by the system: 1^62 - 1.
33 | * @pre Maximum supply must be positive;
34 | */
35 | [[eosio::action]]
36 | void create( const name& issuer,
37 | const asset& maximum_supply);
38 | /**
39 | * This action issues to `to` account a `quantity` of tokens.
40 | *
41 | * @param to - the account to issue tokens to, it must be the same as the issuer,
42 | * @param quntity - the amount of tokens to be issued,
43 | * @memo - the memo string that accompanies the token issue transaction.
44 | */
45 | [[eosio::action]]
46 | void issue( const name& to, const asset& quantity, const string& memo );
47 |
48 | /**
49 | * The opposite for create action, if all validations succeed,
50 | * it debits the statstable.supply amount.
51 | *
52 | * @param quantity - the quantity of tokens to retire,
53 | * @param memo - the memo string to accompany the transaction.
54 | */
55 | [[eosio::action]]
56 | void retire( const asset& quantity, const string& memo );
57 |
58 | /**
59 | * Allows `from` account to transfer to `to` account the `quantity` tokens.
60 | * One account is debited and the other is credited with quantity tokens.
61 | *
62 | * @param from - the account to transfer from,
63 | * @param to - the account to be transferred to,
64 | * @param quantity - the quantity of tokens to be transferred,
65 | * @param memo - the memo string to accompany the transaction.
66 | */
67 | [[eosio::action]]
68 | void transfer( const name& from,
69 | const name& to,
70 | const asset& quantity,
71 | const string& memo );
72 | /**
73 | * Allows `ram_payer` to create an account `owner` with zero balance for
74 | * token `symbol` at the expense of `ram_payer`.
75 | *
76 | * @param owner - the account to be created,
77 | * @param symbol - the token to be payed with by `ram_payer`,
78 | * @param ram_payer - the account that supports the cost of this action.
79 | *
80 | * More information can be read [here](https://github.com/EOSIO/eosio.contracts/issues/62)
81 | * and [here](https://github.com/EOSIO/eosio.contracts/issues/61).
82 | */
83 | [[eosio::action]]
84 | void open( const name& owner, const symbol& symbol, const name& ram_payer );
85 |
86 | /**
87 | * This action is the opposite for open, it closes the account `owner`
88 | * for token `symbol`.
89 | *
90 | * @param owner - the owner account to execute the close action for,
91 | * @param symbol - the symbol of the token to execute the close action for.
92 | *
93 | * @pre The pair of owner plus symbol has to exist otherwise no action is executed,
94 | * @pre If the pair of owner plus symbol exists, the balance has to be zero.
95 | */
96 | [[eosio::action]]
97 | void close( const name& owner, const symbol& symbol );
98 |
99 | static asset get_supply( const name& token_contract_account, const symbol_code& sym_code )
100 | {
101 | stats statstable( token_contract_account, sym_code.raw() );
102 | const auto& st = statstable.get( sym_code.raw() );
103 | return st.supply;
104 | }
105 |
106 | static asset get_balance( const name& token_contract_account, const name& owner, const symbol_code& sym_code )
107 | {
108 | accounts accountstable( token_contract_account, owner.value );
109 | const auto& ac = accountstable.get( sym_code.raw() );
110 | return ac.balance;
111 | }
112 |
113 | using create_action = eosio::action_wrapper<"create"_n, &token::create>;
114 | using issue_action = eosio::action_wrapper<"issue"_n, &token::issue>;
115 | using retire_action = eosio::action_wrapper<"retire"_n, &token::retire>;
116 | using transfer_action = eosio::action_wrapper<"transfer"_n, &token::transfer>;
117 | using open_action = eosio::action_wrapper<"open"_n, &token::open>;
118 | using close_action = eosio::action_wrapper<"close"_n, &token::close>;
119 | private:
120 | struct [[eosio::table]] account {
121 | asset balance;
122 |
123 | uint64_t primary_key()const { return balance.symbol.code().raw(); }
124 | };
125 |
126 | struct [[eosio::table]] currency_stats {
127 | asset supply;
128 | asset max_supply;
129 | name issuer;
130 |
131 | uint64_t primary_key()const { return supply.symbol.code().raw(); }
132 | };
133 |
134 | typedef eosio::multi_index< "accounts"_n, account > accounts;
135 | typedef eosio::multi_index< "stat"_n, currency_stats > stats;
136 |
137 | void sub_balance( const name& owner, const asset& value );
138 | void add_balance( const name& owner, const asset& value, const name& ram_payer );
139 | };
140 |
141 | }
142 |
--------------------------------------------------------------------------------
/docs/03_guides/06_how-to-sign-a-multisig-transaction-with-eosio.msig.md:
--------------------------------------------------------------------------------
1 | ## eosio.msig examples
2 |
3 | ### Cleos usage example for issuing tokens.
4 |
5 | #### Prerequisites:
6 | - eosio.token contract installed to eosio.token account, eosio.msig contract installed on eosio.msig account which is a priviliged account.
7 | - account 'treasury' is the issuer of SYS token.
8 | - account 'tester' exists.
9 | - keys to accounts 'treasury' and 'tester' imported into local wallet, the wallet is unlocked.
10 |
11 | #### One user creates a proposal:
12 | ````
13 | $ cleos multisig propose test '[{"actor": "treasury", "permission": "active"}]' '[{"actor": "treasury", "permission": "active"}]' eosio.token issue '{"to": "tester", "quantity": "1000.0000 SYS", "memo": ""}' -p tester
14 |
15 | executed transaction: e26f3a3a7cba524a7b15a0b6c77c7daa73d3ba9bf84e83f9c2cdf27fcb183d61 336 bytes 107520 cycles
16 | # eosio.msig <= eosio.msig::propose {"proposer":"tester","proposal_name":"test","requested":[{"actor":"treasury","permission":"active"}]...
17 | ````
18 |
19 | #### Another user reviews the transaction:
20 | ````
21 | $ cleos multisig review tester test
22 | {
23 | "proposal_name": "test",
24 | "requested_approvals": [{
25 | "actor": "treasury",
26 | "permission": "active"
27 | }
28 | ],
29 | "provided_approvals": [],
30 | "packed_transaction": "00aee75a0000000000000000000000000100a6823403ea30550000000000a5317601000000fe6a6cd4cd00000000a8ed323219000000005c95b1ca809698000000000004454f530000000000",
31 | "transaction": {
32 | "expiration": "2018-05-01T00:00:00",
33 | "region": 0,
34 | "ref_block_num": 0,
35 | "ref_block_prefix": 0,
36 | "max_net_usage_words": 0,
37 | "max_kcpu_usage": 0,
38 | "delay_sec": 0,
39 | "context_free_actions": [],
40 | "actions": [{
41 | "account": "eosio.token",
42 | "name": "issue",
43 | "authorization": [{
44 | "actor": "treasury",
45 | "permission": "active"
46 | }
47 | ],
48 | "data": {
49 | "to": "tester",
50 | "quantity": "1000.0000 SYS",
51 | "memo": ""
52 | },
53 | "hex_data": "000000005c95b1ca809698000000000004454f530000000000"
54 | }
55 | ]
56 | }
57 | }
58 | ````
59 |
60 | #### And then approves it:
61 | ````
62 | $ cleos multisig approve tester test '{"actor": "treasury", "permission": "active"}' -p treasury
63 |
64 | executed transaction: 475970a4b0016368d0503d1ce01577376f91f5a5ba63dd4353683bd95101b88d 256 bytes 108544 cycles
65 | # eosio.msig <= eosio.msig::approve {"proposer":"tester","proposal_name":"test","level":{"actor":"treasury","permission":"active"}}
66 | ````
67 |
68 | #### First user initiates execution:
69 | ````
70 | $ cleos multisig exec tester test -p tester
71 |
72 | executed transaction: 64e5eaceb77362694055f572ae35876111e87b637a55250de315b1b55e56d6c2 248 bytes 109568 cycles
73 | # eosio.msig <= eosio.msig::exec {"proposer":"tester","proposal_name":"test","executer":"tester"}
74 | ````
75 |
76 |
77 | ### Cleos usage example for transferring tokens.
78 |
79 | #### Prerequisites:
80 | - eosio.token contract installed to eosio.token account, eosio.msig contract installed on eosio.msig account which is a priviliged account.
81 | - account 'treasury' has at least 1.1000 SYS token balance.
82 | - account 'tester' exists.
83 | - keys to accounts 'treasury' and 'tester' imported into local wallet, the wallet is unlocked.
84 |
85 | #### One user creates a proposal:
86 | ````
87 | $ cleos multisig propose test '[{"actor": "treasury", "permission": "active"}]' '[{"actor": "treasury", "permission": "active"}]' eosio.token transfer '{"from": "treasury", "to": "tester", "quantity": "1.0000 SYS", "memo": ""}' -p tester
88 |
89 | executed transaction: e26f3a3a7cba524a7b15a0b6c77c7daa73d3ba9bf84e83f9c2cdf27fcb183d61 336 bytes 107520 cycles
90 | # eosio.msig <= eosio.msig::propose {"proposer":"tester","proposal_name":"test","requested":[{"actor":"treasury","permission":"active"}]...
91 | ````
92 |
93 | #### Another user reviews the transaction:
94 | ````
95 | $ cleos multisig review tester test
96 | {
97 | "proposal_name": "test",
98 | "requested_approvals": [{
99 | "actor": "treasury",
100 | "permission": "active"
101 | }
102 | ],
103 | "provided_approvals": [],
104 | "packed_transaction": "00aee75a0000000000000000000000000100a6823403ea30550000000000a5317601000000fe6a6cd4cd00000000a8ed323219000000005c95b1ca809698000000000004454f530000000000",
105 | "transaction": {
106 | "expiration": "2018-05-01T00:00:00",
107 | "region": 0,
108 | "ref_block_num": 0,
109 | "ref_block_prefix": 0,
110 | "max_net_usage_words": 0,
111 | "max_kcpu_usage": 0,
112 | "delay_sec": 0,
113 | "context_free_actions": [],
114 | "actions": [{
115 | "account": "eosio.token",
116 | "name": "transfer",
117 | "authorization": [{
118 | "actor": "treasury",
119 | "permission": "active"
120 | }
121 | ],
122 | "data": {
123 | "from": "treasury",
124 | "to": "tester",
125 | "quantity": "1.0000 SYS",
126 | "memo": ""
127 | },
128 | "hex_data": "000000005c95b1ca809698000000000004454f530000000000"
129 | }
130 | ]
131 | }
132 | }
133 | ````
134 |
135 | #### And then approves it:
136 | ````
137 | $ cleos multisig approve tester test '{"actor": "treasury", "permission": "active"}' -p treasury
138 |
139 | executed transaction: 475970a4b0016368d0503d1ce01577376f91f5a5ba63dd4353683bd95101b88d 256 bytes 108544 cycles
140 | # eosio.msig <= eosio.msig::approve {"proposer":"tester","proposal_name":"test","level":{"actor":"treasury","permission":"active"}}
141 | ````
142 |
143 | #### First user check account balance before executing the proposed transaction
144 | ````
145 | $ cleos get account tester
146 | ...
147 | SYS balances:
148 | liquid: 1.0487 SYS
149 | staked: 2.0000 SYS
150 | unstaking: 0.0000 SYS
151 | total: 4.0487 SYS
152 | ````
153 |
154 | #### First user initiates execution of proposed transaction:
155 | ````
156 | $ cleos multisig exec tester test -p tester
157 |
158 | executed transaction: 64e5eaceb77362694055f572ae35876111e87b637a55250de315b1b55e56d6c2 248 bytes 109568 cycles
159 | # eosio.msig <= eosio.msig::exec {"proposer":"tester","proposal_name":"test","executer":"tester"}
160 | ````
161 |
162 | #### First user can check account balance, it should be increased by 1.0000 SYS
163 | ````
164 | $ cleos get account tester
165 | ...
166 | SYS balances:
167 | liquid: 2.0487 SYS
168 | staked: 2.0000 SYS
169 | unstaking: 0.0000 SYS
170 | total: 4.0487 SYS
171 | ````
172 |
--------------------------------------------------------------------------------
/contracts/eosio.proton/ricardian/eosio.proton.contracts.md:
--------------------------------------------------------------------------------
1 |
35 |
36 | ---
37 | spec_version: "0.2.0"
38 | title: Link Action to Permission
39 | summary: '{{nowrap account}} sets the minimum required permission for the {{#if type}}{{nowrap type}} action of the{{/if}} {{nowrap code}} contract to {{nowrap requirement}}'
40 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
41 | ---
42 |
43 | {{account}} sets the minimum required permission for the {{#if type}}{{type}} action of the{{/if}} {{code}} contract to {{requirement}}.
44 |
45 | {{#if type}}{{else}}Any links explicitly associated to specific actions of {{code}} will take precedence.{{/if}}
46 |
47 |
newaccount
48 |
49 | ---
50 | spec_version: "0.2.0"
51 | title: Create New Account
52 | summary: '{{nowrap creator}} creates a new account with the name {{nowrap name}}'
53 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
54 | ---
55 |
56 | {{creator}} creates a new account with the name {{name}} and the following permissions:
57 |
58 | owner permission with authority:
59 | {{to_json owner}}
60 |
61 | active permission with authority:
62 | {{to_json active}}
63 |
64 |
reqactivated
65 |
66 | ---
67 | spec_version: "0.2.0"
68 | title: Assert Protocol Feature Activation
69 | summary: 'Assert that protocol feature {{nowrap feature_digest}} has been activated'
70 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e
71 | ---
72 |
73 | Assert that the protocol feature with a digest of {{feature_digest}} has been activated.
74 |
75 |
reqauth
76 |
77 | ---
78 | spec_version: "0.2.0"
79 | title: Assert Authorization
80 | summary: 'Assert that authorization by {{nowrap from}} is provided'
81 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
82 | ---
83 |
84 | Assert that authorization by {{from}} is provided.
85 |
86 |
setabi
87 |
88 | ---
89 | spec_version: "0.2.0"
90 | title: Deploy Contract ABI
91 | summary: 'Deploy contract ABI on account {{nowrap account}}'
92 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
93 | ---
94 |
95 | Deploy the ABI file associated with the contract on account {{account}}.
96 |
97 |
setalimits
98 |
99 | ---
100 | spec_version: "0.2.0"
101 | title: Adjust Resource Limits of Account
102 | summary: 'Adjust resource limits of account {{nowrap account}}'
103 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e
104 | ---
105 |
106 | {{$action.account}} updates {{account}}’s resource limits to have a RAM quota of {{ram_bytes}} bytes, a NET bandwidth quota of {{net_weight}} and a CPU bandwidth quota of {{cpu_weight}}.
107 |
108 |
120 |
121 | ---
122 | spec_version: "0.2.0"
123 | title: Set System Parameters
124 | summary: 'Set system parameters'
125 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e
126 | ---
127 |
128 | {{$action.account}} sets system parameters to:
129 | {{to_json params}}
130 |
131 |
setpriv
132 |
133 | ---
134 | spec_version: "0.2.0"
135 | title: Make an Account Privileged or Unprivileged
136 | summary: '{{#if is_priv}}Make {{nowrap account}} privileged{{else}}Remove privileged status of {{nowrap account}}{{/if}}'
137 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e
138 | ---
139 |
140 | {{#if is_priv}}
141 | {{$action.account}} makes {{account}} privileged.
142 | {{else}}
143 | {{$action.account}} removes privileged status of {{account}}.
144 | {{/if}}
145 |
146 |
setprods
147 |
148 | ---
149 | spec_version: "0.2.0"
150 | title: Set Block Producers
151 | summary: 'Set block producer schedule'
152 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e
153 | ---
154 |
155 | {{$action.account}} proposes a block producer schedule of:
156 | {{#each schedule}}
157 | 1. {{this.producer_name}}
158 | {{/each}}
159 |
160 | The block signing authorities of each of the producers in the above schedule are listed below:
161 | {{#each schedule}}
162 | ### {{this.producer_name}}
163 | {{to_json this.authority}}
164 | {{/each}}
165 |
166 |
unlinkauth
167 |
168 | ---
169 | spec_version: "0.2.0"
170 | title: Unlink Action from Permission
171 | summary: '{{nowrap account}} unsets the minimum required permission for the {{#if type}}{{nowrap type}} action of the{{/if}} {{nowrap code}} contract'
172 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
173 | ---
174 |
175 | {{account}} removes the association between the {{#if type}}{{type}} action of the{{/if}} {{code}} contract and its minimum required permission.
176 |
177 | {{#if type}}{{else}}This will not remove any links explicitly associated to specific actions of {{code}}.{{/if}}
178 |
179 |
updateauth
180 |
181 | ---
182 | spec_version: "0.2.0"
183 | title: Modify Account Permission
184 | summary: 'Add or update the {{nowrap permission}} permission of {{nowrap account}}'
185 | icon: https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
186 | ---
187 |
188 | Modify, and create if necessary, the {{permission}} permission of {{account}} to have a parent permission of {{parent}} and the following authority:
189 | {{to_json auth}}
190 |
--------------------------------------------------------------------------------