Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ else
CDT_DIR_CMAKE_OPTION="-Dcdt_DIR=${CDT_INSTALL_DIR}/lib/cmake/cdt"
fi

printf "\t=========== Building eos-system-contracts ===========\n\n"
printf "\t=========== Building system-contracts ===========\n\n"
RED='\033[0;31m'
NC='\033[0m'
CPU_CORES=$(getconf _NPROCESSORS_ONLN)
Expand Down
4 changes: 2 additions & 2 deletions contracts/eosio.bpay/include/eosio.bpay/eosio.bpay.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ namespace eosio {
* ## TABLE `rewards`
*
* @param owner - block producer owner account
* @param quantity - reward quantity in SYS (or other token)
* @param quantity - reward quantity in A (or other token)
*
* ### example
*
* ```json
* [
* {
* "owner": "alice",
* "quantity": "8.800 SYS"
* "quantity": "8.800 A"
* }
* ]
* ```
Expand Down
16 changes: 8 additions & 8 deletions contracts/eosio.system/include/eosio.system/eosio.system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,8 @@ namespace eosiosystem {
// - `version` defaulted to zero,
// - `from` account creating and paying for loan,
// - `receiver` account receiving rented resources,
// - `payment` SYS tokens paid for the loan,
// - `balance` is the amount of SYS tokens available to be used for loan auto-renewal,
// - `payment` A tokens paid for the loan,
// - `balance` is the amount of A tokens available to be used for loan auto-renewal,
// - `total_staked` total amount staked,
// - `loan_num` loan number/id,
// - `expiration` the expiration time when loan will be either closed or renewed
Expand Down Expand Up @@ -770,7 +770,7 @@ namespace eosiosystem {
uint8_t version = 0;
int64_t weight = 0; // resource market weight. calculated; varies over time.
// 1 represents the same amount of resources as 1
// satoshi of SYS staked.
// satoshi of A staked.
int64_t weight_ratio = 0; // resource market weight ratio:
// assumed_stake_weight / (assumed_stake_weight + weight).
// calculated; varies over time. 1x = 10^15. 0.01x = 10^13.
Expand Down Expand Up @@ -1069,7 +1069,7 @@ namespace eosiosystem {
// functions defined in delegate_bandwidth.cpp

/**
* Delegate bandwidth and/or cpu action. Stakes SYS from the balance of `from` for the benefit of `receiver`.
* Delegate bandwidth and/or cpu action. Stakes A from the balance of `from` for the benefit of `receiver`.
*
* @param from - the account to delegate bandwidth from, that is, the account holding
* tokens to be staked,
Expand Down Expand Up @@ -1172,7 +1172,7 @@ namespace eosiosystem {
void cnclrexorder( const name& owner );

/**
* Rentcpu action, uses payment to rent as many SYS tokens as possible as determined by market price and
* Rentcpu action, uses payment to rent as many A tokens as possible as determined by market price and
* stake them for CPU for the benefit of receiver, after 30 days the rented core delegation of CPU
* will expire. At expiration, if balance is greater than or equal to `loan_payment`, `loan_payment`
* is taken out of loan balance and used to renew the loan. Otherwise, the loan is closed and user
Expand All @@ -1192,7 +1192,7 @@ namespace eosiosystem {
void rentcpu( const name& from, const name& receiver, const asset& loan_payment, const asset& loan_fund );

/**
* Rentnet action, uses payment to rent as many SYS tokens as possible as determined by market price and
* Rentnet action, uses payment to rent as many A tokens as possible as determined by market price and
* stake them for NET for the benefit of receiver, after 30 days the rented core delegation of NET
* will expire. At expiration, if balance is greater than or equal to `loan_payment`, `loan_payment`
* is taken out of loan balance and used to renew the loan. Otherwise, the loan is closed and user
Expand Down Expand Up @@ -1396,7 +1396,7 @@ namespace eosiosystem {
/**
* The buyramself action is designed to enhance the permission security by allowing an account to purchase RAM exclusively for itself.
* This action prevents the potential risk associated with standard actions like buyram and buyrambytes,
* which can transfer tokens out of the account, acting as a proxy for eosio.token::transfer. Token must include symbole, example SYS.
* which can transfer tokens out of the account, acting as a proxy for eosio.token::transfer. Token must include the symbol, example A.
*
* @param account - the ram buyer and receiver,
* @param quant - the quantity of tokens to buy ram with.
Expand Down Expand Up @@ -1678,7 +1678,7 @@ namespace eosiosystem {
* @pre If proxy is set then proxy account must exist and be registered as a proxy
* @pre Every listed producer or proxy must have been previously registered
* @pre Voter must authorize this action
* @pre Voter must have previously staked tokens for voting (example SYS tokens)
* @pre Voter must have previously staked tokens for voting (example A tokens)
* @pre Voter->staked must be up to date
*
* @post Every producer previously voted for will have vote reduced by previous vote weight
Expand Down
2 changes: 1 addition & 1 deletion contracts/eosio.system/src/rex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ namespace eosiosystem {
asset system_contract::add_to_rex_pool( const asset& payment )
{
/**
* If CORE_SYMBOL is (XYZ,4), maximum supply is 10^10 tokens (10 billion tokens), i.e., maximum amount
* If CORE_SYMBOL is (A,4), maximum supply is 10^10 tokens (10 billion tokens), i.e., maximum amount
* of indivisible units is 10^14. rex_ratio = 10^4 sets the upper bound on (REX,4) indivisible units to
* 10^18 and that is within the maximum allowable amount field of asset type which is set to 2^62
* (approximately 4.6 * 10^18). For a different CORE_SYMBOL, and in order for maximum (REX,4) amount not
Expand Down
2 changes: 1 addition & 1 deletion docs/01_key-concepts/02_system_resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To allocate CPU and NET resources to an account you have to [power up the accoun

As a developer if you want to estimate how much CPU and NET a transaction requires for execution, you can employ one of the following methods:

* Use the `--dry-run` option for the `dune -- cleos push transaction` command.
* Use the `--dry-run` option for the `cleos push transaction` command.
* Use any tool that can pack a transaction and send it to the blockchain and specify the `--dry-run` option.
* Use the chain API endpoint [`compute_transaction`](https://github.com/AntelopeIO/spring/blob/7254bab917a17bcc0d82d23d03f4173176150239/plugins/chain_plugin/include/eosio/chain_plugin/chain_plugin.hpp#L557).

Expand Down
18 changes: 9 additions & 9 deletions docs/01_key-concepts/05_ram.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ The RAM resource must be bought with the `Vaulta` system token. The price of RAM

The quickest way to calculate the price of RAM:

1. Run the following dune command: (**Note:** Make sure you run it against the mainnet or the testnet of your choice.)
1. Run the following command: (**Note:** Make sure you run it against the mainnet or the testnet of your choice.)

```shell
dune -- cleos get table eosio eosio rammarket
cleos get table eosio eosio rammarket
```

2. Observe the output which should look like the sample below:
Expand All @@ -43,34 +43,34 @@ The quickest way to calculate the price of RAM:
"weight": "0.50000000000000000"
},
"quote": {
"balance": "3158350.8754 XYZ",
"balance": "3158350.8754 A",
"weight": "0.50000000000000000"
}
}
```

3. Make note of the `base balance`, in this case it is 35044821247.
4. Make note of the `quote balance`, in this case it is 3158350.8754.
5. Calculate the price of 1Kib of RAM as `quote balance` * 1024 / `base balance` = 0.0922 XYZ.
5. Calculate the price of 1Kib of RAM as `quote balance` * 1024 / `base balance` = 0.0922 A.

### Buy RAM With Command Line Interface

You can buy RAM through the dune command line interface tool. You can buy either an explicit amount of RAM expressed in bytes or an amount of RAM worth an explicit amount of Vaulta.
You can buy RAM through the command line interface tool. You can buy either an explicit amount of RAM expressed in bytes or an amount of RAM worth an explicit amount of Vaulta.

### Buy RAM In XYZ
### Buy RAM In A

For example, the command below buys for account `bob` 0.1 XYZ worth of RAM at the current market RAM price. The cost for the RAM and the execution of this transaction is covered by the `alice` account and the transaction is authorized by the `active` key of the `alice` account.
For example, the command below buys for account `bob` 0.1 A worth of RAM at the current market RAM price. The cost for the RAM and the execution of this transaction is covered by the `alice` account and the transaction is authorized by the `active` key of the `alice` account.

```shell
dune -- cleos system buyram alice bob "0.1 XYZ" -p alice@active
cleos system buyram alice bob "0.1 A" -p alice@active
```

### Buy RAM In Bytes

For example, the command below buys for account `bob` 1000 RAM bytes at the current market RAM price. The cost for the RAM and the execution of this transaction is covered by the `alice` account and the transaction is authorized by the `active` key of the `alice` account.

```shell
dune -- cleos system buyrambytes alice bob "1000" -p alice@active
cleos system buyrambytes alice bob "1000" -p alice@active
```

## How Is RAM Calculated
Expand Down
2 changes: 1 addition & 1 deletion docs/01_key-concepts/06_vote.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ title: Voting on Vaulta blockchain

The Vaulta blockchain is kept alive by nodes which are interconnected between each other, communicating with each other via peer to peer protocols. Some of these nodes are elected, via a voting process, by the token holders to be producer nodes. They produce blocks, validate them and reach consensus on what transactions are allowed in each block, their order, and what blocks are finalized and stored forever in the blockchain state. This way the governance, the mechanism by which collective decisions are made, of the blockchain is achieved through the 21 active block producers which are appointed by token holders' votes. It is the 21 active block producers which continuously advancing the blockchain by creating blocks, and securing them by validating them, and reaching consensus. Consensus is reached when 2/3+1 active block producers agree on validity of a block, that is all transactions contained in it and their order. The 21 producers is the default value however it can be configured to be higher or smaller to meet each business case requirements.

The 21 block producers are elected through the voting process. Each XYZ token holder that wants to vote for one or up to 30 block producers must stake their tokens. The more tokens are stake the more voting power. The voting power of one account is proportional with the amount of tokens staked by that account versus the total amount of tokens staked by whole accounts that stake their tokens.
The 21 block producers are elected through the voting process. Each A token holder that wants to vote for one or up to 30 block producers must stake their tokens. The more tokens are stake the more voting power. The voting power of one account is proportional with the amount of tokens staked by that account versus the total amount of tokens staked by whole accounts that stake their tokens.
16 changes: 8 additions & 8 deletions docs/01_key-concepts/07_powerup_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ To power up an account is a technique to rent CPU and NET resources from the Pow
* The `receiver` of the resources, must be a valid Vaulta account.
* The `days` which must always match `state.powerup_days` specified in the [PowerUp configuration settings](https://github.com/VaultaFoundation/system-contracts/blob/7cec470b17bd53b8c78465d4cbd889dbaf1baffb/contracts/eosio.system/include/eosio.system/eosio.system.hpp#L588).
* The `net_frac`, and the `cpu_frac` are the percentage of the resources that you need. The easiest way to calculate the percentage is to multiple 10^15 (100%) by the desired percentage. For example: 10^15 * 0.01 = 10^13.
* The `max_payment`, must be expressed in XYZ and is the maximum amount the `payer` is willing to pay.
* The `max_payment`, must be expressed in A and is the maximum amount the `payer` is willing to pay.

```sh
cleos push action eosio powerup '[user, user, 1, 10000000000000, 10000000000000, "1000.0000 XYZ"]' -p user
cleos push action eosio powerup '[user, user, 1, 10000000000000, 10000000000000, "1000.0000 A"]' -p user
```

To view the received NET and CPU weight as well as the amount of the fee, check the `eosio.reserv::powupresult` returned by the action, which should look similar to the one below:

```console
executed transaction: 82b7124601612b371b812e3bf65cf63bb44616802d3cd33a2c0422b58399f54f 144 bytes 521 us
# eosio <= eosio::powerup {"payer":"user","receiver":"user","days":1,"net_frac":"10000000000000","cpu_frac":"10000000000000","...
# eosio.token <= eosio.token::transfer {"from":"user","to":"eosio.rex","quantity":"999.9901 XYZ","memo":"transfer from user to eosio.rex"}
# eosio.reserv <= eosio.reserv::powupresult {"fee":"999.9901 XYZ","powup_net_weight":"16354","powup_cpu_weight":"65416"}
# user <= eosio.token::transfer {"from":"user","to":"eosio.rex","quantity":"999.9901 XYZ","memo":"transfer from user to eosio.rex"}
# eosio.rex <= eosio.token::transfer {"from":"user","to":"eosio.rex","quantity":"999.9901 XYZ","memo":"transfer from user to eosio.rex"}
# eosio.token <= eosio.token::transfer {"from":"user","to":"eosio.rex","quantity":"999.9901 A","memo":"transfer from user to eosio.rex"}
# eosio.reserv <= eosio.reserv::powupresult {"fee":"999.9901 A","powup_net_weight":"16354","powup_cpu_weight":"65416"}
# user <= eosio.token::transfer {"from":"user","to":"eosio.rex","quantity":"999.9901 A","memo":"transfer from user to eosio.rex"}
# eosio.rex <= eosio.token::transfer {"from":"user","to":"eosio.rex","quantity":"999.9901 A","memo":"transfer from user to eosio.rex"}
```

The PowerUp resource model on the Vaulta blockchain is initialized with `"powerup_days": 1,`. This setting permits the maximum period to rent CPU and NET for 24 hours. If you do not use the resources within the 24 hour interval, the rented CPU and NET expires.
Expand All @@ -38,7 +38,7 @@ Any calls to the `powerup` action does process also this queue (limited to two e
To view the orders table `powup.order` execute the following command:

```sh
dune -- cleos get table eosio 0 powup.order
cleos get table eosio 0 powup.order
```

```json
Expand All @@ -60,7 +60,7 @@ dune -- cleos get table eosio 0 powup.order
Example `powerupexec` call:

```sh
dune -- cleos push action eosio powerupexec '[user, 2]' -p user
cleos push action eosio powerupexec '[user, 2]' -p user
```

```console
Expand Down
4 changes: 2 additions & 2 deletions docs/04_guides/02_how-to-buy-ram.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Setup an account that require multiple signatures for signing a transaction

## Steps

Buys RAM in value of 10 XYZ tokens for account `alice`:
Buys RAM in value of 10 A tokens for account `alice`:

```shell
cleos system buyram alice alice "10 XYZ" -p alice@active
cleos system buyram alice alice "10 A" -p alice@active
```
8 changes: 4 additions & 4 deletions docs/04_guides/03_how-to-stake.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ Stake resources for your account to participate in the on-chain voting and gover

## Steps

Stake 10 XYZ network bandwidth for `alice`
Stake 10 A network bandwidth for `alice`

```shell
cleos system delegatebw alice alice "0 XYZ" "10 XYZ"
cleos system delegatebw alice alice "0 A" "10 A"
```

Stake 10 XYZ CPU bandwidth for `alice`:
Stake 10 A CPU bandwidth for `alice`:

```shell
cleos system delegatebw alice alice "10 XYZ" "0 XYZ"
cleos system delegatebw alice alice "10 A" "0 A"
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ link_text: How to sign a multisig transaction with eosio.msig

### Prerequisites:
- eosio.token contract installed to eosio.token account, eosio.msig contract installed on eosio.msig account which is a priviliged account.
- account 'treasury' is the issuer of XYZ token.
- account 'treasury' is the issuer of A token.
- account 'tester' exists.
- keys to accounts 'treasury' and 'tester' imported into local wallet, the wallet is unlocked.

### One user creates a proposal:
```sh
cleos multisig propose test '[{"actor": "treasury", "permission": "active"}]' '[{"actor": "treasury", "permission": "active"}]' eosio.token issue '{"to": "tester", "quantity": "1000.0000 XYZ", "memo": ""}' -p tester
cleos multisig propose test '[{"actor": "treasury", "permission": "active"}]' '[{"actor": "treasury", "permission": "active"}]' eosio.token issue '{"to": "tester", "quantity": "1000.0000 A", "memo": ""}' -p tester
```
```console
executed transaction: e26f3a3a7cba524a7b15a0b6c77c7daa73d3ba9bf84e83f9c2cdf27fcb183d61 336 bytes 107520 cycles
Expand Down Expand Up @@ -53,7 +53,7 @@ cleos multisig review tester test
],
"data": {
"to": "tester",
"quantity": "1000.0000 XYZ",
"quantity": "1000.0000 A",
"memo": ""
},
"hex_data": "000000005c95b1ca809698000000000004454f530000000000"
Expand Down Expand Up @@ -86,13 +86,13 @@ executed transaction: 64e5eaceb77362694055f572ae35876111e87b637a55250de315b1b55e

### Prerequisites:
- eosio.token contract installed to eosio.token account, eosio.msig contract installed on eosio.msig account which is a priviliged account.
- account 'treasury' has at least 1.1000 XYZ token balance.
- account 'treasury' has at least 1.1000 A token balance.
- account 'tester' exists.
- keys to accounts 'treasury' and 'tester' imported into local wallet, the wallet is unlocked.

### One user creates a proposal:
```sh
cleos multisig propose test '[{"actor": "treasury", "permission": "active"}]' '[{"actor": "treasury", "permission": "active"}]' eosio.token transfer '{"from": "treasury", "to": "tester", "quantity": "1.0000 XYZ", "memo": ""}' -p tester
cleos multisig propose test '[{"actor": "treasury", "permission": "active"}]' '[{"actor": "treasury", "permission": "active"}]' eosio.token transfer '{"from": "treasury", "to": "tester", "quantity": "1.0000 A", "memo": ""}' -p tester
```
```console
executed transaction: e26f3a3a7cba524a7b15a0b6c77c7daa73d3ba9bf84e83f9c2cdf27fcb183d61 336 bytes 107520 cycles
Expand Down Expand Up @@ -133,7 +133,7 @@ cleos multisig review tester test
"data": {
"from": "treasury",
"to": "tester",
"quantity": "1.0000 XYZ",
"quantity": "1.0000 A",
"memo": ""
},
"hex_data": "000000005c95b1ca809698000000000004454f530000000000"
Expand All @@ -158,11 +158,11 @@ cleos get table core.vaulta tester accounts | jq '.rows[]'
```
```console
...
XYZ balances:
liquid: 1.0487 XYZ
staked: 2.0000 XYZ
unstaking: 0.0000 XYZ
total: 4.0487 XYZ
A balances:
liquid: 1.0487 A
staked: 2.0000 A
unstaking: 0.0000 A
total: 4.0487 A
```

### First user initiates execution of proposed transaction:
Expand All @@ -174,15 +174,15 @@ executed transaction: 64e5eaceb77362694055f572ae35876111e87b637a55250de315b1b55e
# eosio.msig <= eosio.msig::exec {"proposer":"tester","proposal_name":"test","executer":"tester"}
```

### First user can check account balance, it should be increased by 1.0000 XYZ
### First user can check account balance, it should be increased by 1.0000 A
```sh
cleos get table core.vaulta tester accounts | jq '.rows[]'
```
```console
...
XYZ balances:
liquid: 2.0487 XYZ
staked: 2.0000 XYZ
unstaking: 0.0000 XYZ
total: 4.0487 XYZ
A balances:
liquid: 2.0487 A
staked: 2.0000 A
unstaking: 0.0000 A
total: 4.0487 A
```
Loading