Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

EOSIO Contracts v1.6.0 Release Notes

Compare
Choose a tag to compare
@blockone-devops blockone-devops released this 29 Mar 01:37
· 583 commits to master since this release
8c03c91

The Resource Exchange, REX (#94, #182, #196, #208)

This release provides an example of a system contract that provides the resource exchange (REX) functionality for the community to review, adapt, and build on. The contract functionality is provided within the eosio.system contract while the corresponding user interfaces, deployment choices, etc. are not provided. As designed, REX is a CPU and Network resource rental market in which holders of the core token of the blockchain can lend portions of their existing resource allocations by buying and selling REX tokens into the REX pool. Core token holders are allowed to participate in the REX pool only after having voted for at least 21 Block Producers or have delegated their votes to one proxy. Blockchain users can then rent CPU and Network resources from the REX pool to meet their resource needs. The duration of each loan, as designed, is 30 days and the loan price is determined by an automated market maker. Note that a REX token is not tradable, it is merely a convenient accounting unit and helps determine the return rate available to REX holders as determined by the level of rental activity. Optionally, proceeds from RAM trading fees and account name auctions can also be channeled to the REX pool, thus providing an additional source of return to REX holders.

For more information about REX see the description in issue #117.

Channeling system fees to REX

The source code of the eosio.system contract is by default set up to channel the account name auction fees and the fees collected from buying and selling RAM to the REX pool. The channeling of these fees only occurs for new fees collected; it does not impact any of the funds already collected in the eosio.ramfee and eosio.names accounts.

The channeling of these fees can be disabled in the source code by setting the CHANNEL_RAM_AND_NAMEBID_FEES_TO_REX macro (defined in eosio.system.hpp) to 0.

Deployment

The REX introduces new setup requirements for initializing the system contract.

The account eosio.rex must now be created in addition to all the other existing system accounts prior to deploying the new system contract. eosio.rex must not be a privileged account.

The eosio::init action, which is only needed when deploying the system contract to a blockchain for the first time, was introduced in v1.4.0 of eosio.contracts. In this release, it has further been modified to send an inline eosio.token::open action to open a zero-balance entry corresponding to the core token symbol for the eosio.rex account. The eosio.token::open action was first introduced to the eosio.token contract in v1.3.0 of eosio.contracts. It is recommended to deploy a recent version of the token contract (at a minimum version 1.3.1) to the eosio.token account prior to deploying the new system contract. If an older version of the token contract is deployed, the eosio::init action will still succeed, however when the inline eosio.token::open action executes it may do nothing.

If this version of the system contract is replacing an existing deployment of an older version of the eosio.system contract, then no eosio::init action is necessary or even allowed. Block Producers can optionally execute the eosio.token::open action to create the zero-balance entry to the core token symbol for the eosio.rex account.

ABI file rex.results.abi (generated automatically) needs to be deployed on account eosio.rex. The corresponding contract rex.results.wasm must NOT be deployed. The actions buyresult, sellresult, rentresult, and orderresult of rex.results are all no-ops. They are added as inline convenience actions to rentnet, rentcpu, buyrex, unstaketorex, and sellrex. An inline convenience action does not have any effect, however, its data includes the result of the parent action and appears in its trace.

Adjusting REX pool virtual balance

Action setrex allows Block Producers to reset the total_rent balance of the REX pool to a given value, if the need arises. It is important to note that this action is NOT required to initialize the REX system and is not recommended to be used more than once. It is a backup mechanism that allows Block Producers to balance the renting market prices in case the initial settings were impractical and not in line with the amount of tokens lent to REX. total_rent is a virtual balance and no real tokens will be added or removed in this action.

Dependencies

This release depends on eosio.cdt v1.5.x and eosio v1.6.x or v1.7.x. To compile the contracts in this release, first build and install eosio.cdt v1.5.0 and eosio v1.7.0.

Disclaimer: Block.one makes its contribution on a voluntary basis as a member of the EOSIO community and is not responsible for ensuring the overall performance of the software or any related applications. We make no representation, warranty, guarantee or undertaking in respect of the releases described here, the related GitHub release, the EOSIO software or any related documentation, whether expressed or implied, including but not limited to the warranties or 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 documentation or the use or other dealings in the software or documentation. Any test results or performance figures are indicative and will not reflect performance under all conditions. Any reference to any third party or third-party product, resource or service is not an endorsement or recommendation by Block.one. We are not responsible, 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 the information here may be out of date or inaccurate.