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

Commit

Permalink
Merge pull request #9 from EOSIO/merge-release-2.0.0-rc1-to-main
Browse files Browse the repository at this point in the history
Merge release 2.0.0 rc1 to main
  • Loading branch information
WarrickFitz authored Mar 10, 2021
2 parents ee329c3 + 5083cb5 commit 28c46de
Show file tree
Hide file tree
Showing 27 changed files with 64 additions and 1,971 deletions.
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
cmake_minimum_required(VERSION 3.5)

project(eosio_contracts)
project(eosio_token)

set(VERSION_MAJOR 1)
set(VERSION_MINOR 9)
set(VERSION_PATCH 2)
#set(VERSION_SUFFIX rc4)
set(VERSION_MAJOR 2)
set(VERSION_MINOR 0)
set(VERSION_PATCH 0)
set(VERSION_SUFFIX rc1)

if (VERSION_SUFFIX)
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_SUFFIX}")
Expand All @@ -17,7 +17,7 @@ include(ExternalProject)

find_package(eosio.cdt)

message(STATUS "Building eosio.contracts v${VERSION_FULL}")
message(STATUS "Building eosio.token v${VERSION_FULL}")

set(EOSIO_CDT_VERSION_MIN "1.8")
set(EOSIO_CDT_VERSION_SOFT_MAX "1.8")
Expand Down Expand Up @@ -82,7 +82,7 @@ if(BUILD_TESTS)
ExternalProject_Add(
contracts_unit_tests
LIST_SEPARATOR | # Use the alternate list separator
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}
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} -DBUILD_TESTS_PINNED=${BUILD_TESTS_PINNED} -DEOSIO_DIR_PROMPT=${EOSIO_DIR_PROMPT}
SOURCE_DIR ${CMAKE_SOURCE_DIR}/tests
BINARY_DIR ${CMAKE_BINARY_DIR}/tests
BUILD_ALWAYS 1
Expand Down
22 changes: 11 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Contributing to eosio.contracts
# Contributing to eosio.token

Interested in contributing? That's awesome! Here are some guidelines to get started quickly and easily:

- [Reporting An Issue](#reporting-an-issue)
- [Bug Reports](#bug-reports)
- [Feature Requests](#feature-requests)
- [Change Requests](#change-requests)
- [Working on eosio.contracts](#working-on-eosiocontracts)
- [Working on eosio.token](#working-on-eosio.token)
- [Feature Branches](#feature-branches)
- [Submitting Pull Requests](#submitting-pull-requests)
- [Testing and Quality Assurance](#testing-and-quality-assurance)
Expand All @@ -16,7 +16,7 @@ Interested in contributing? That's awesome! Here are some guidelines to get star

## Reporting An Issue

If you're about to raise an issue because you think you've found a problem with eosio.contracts, or you'd like to make a request for a new feature in the codebase, or any other reason… please read this first.
If you're about to raise an issue because you think you've found a problem with eosio.token, or you'd like to make a request for a new feature in the codebase, or any other reason… please read this first.

The GitHub issue tracker is the preferred channel for [bug reports](#bug-reports), [feature requests](#feature-requests), and [submitting pull requests](#submitting-pull-requests), but please respect the following restrictions:

Expand All @@ -34,12 +34,12 @@ Guidelines for bug reports:
reported.

1. **Check if the issue has been fixed** — look for [closed issues in the
current milestone](https://github.com/EOSIO/eosio.contracts/issues?q=is%3Aissue+is%3Aclosed) or try to reproduce it
current milestone](https://github.com/EOSIO/eosio.token/issues?q=is%3Aissue+is%3Aclosed) or try to reproduce it
using the latest `develop` branch.

A good bug report shouldn't leave others needing to chase you up for more information. Be sure to include the details of your environment and relevant tests that demonstrate the failure.

[Report a bug](https://github.com/EOSIO/eosio.contracts/issues/new?title=Bug%3A)
[Report a bug](https://github.com/EOSIO/eosio.token/issues/new?title=Bug%3A)

### Feature Requests

Expand All @@ -51,24 +51,24 @@ Feature requests are welcome. Before you submit one be sure to have:

### Change Requests

Change requests cover both architectural and functional changes to how eosio.contracts works. If you have an idea for a new or different dependency, a refactor, or an improvement to a feature, etc - please be sure to:
Change requests cover both architectural and functional changes to how eosio.token works. If you have an idea for a new or different dependency, a refactor, or an improvement to a feature, etc - please be sure to:

1. **Use the GitHub search** and check someone else didn't get there first
1. Take a moment to think about the best way to make a case for, and explain what you're thinking. Are you sure this shouldn't really be
a [bug report](#bug-reports) or a [feature request](#feature-requests)? Is it really one idea or is it many? What's the context? What problem are you solving? Why is what you are suggesting better than what's already there?

## Working on eosio.contracts
## Working on eosio.token

Code contributions are welcome and encouraged! If you are looking for a good place to start, check out the [good first issue](https://github.com/EOSIO/eosio.contracts/labels/good%20first%20issue) label in GitHub issues.
Code contributions are welcome and encouraged! If you are looking for a good place to start, check out the [good first issue](https://github.com/EOSIO/eosio.token/labels/good%20first%20issue) label in GitHub issues.

Also, please follow these guidelines when submitting code:

### Feature Branches

To get it out of the way:

- **[develop](https://github.com/EOSIO/eosio.contracts/tree/develop)** is the development branch. All work on the next release happens here so you should generally branch off `develop`. Do **NOT** use this branch for a production site.
- **[master](https://github.com/EOSIO/eosio.contracts/tree/master)** contains the latest release of eosio.contracts. This branch may be used in production. Do **NOT** use this branch to work on eosio.contracts's source.
- **[develop](https://github.com/EOSIO/eosio.token/tree/develop)** is the development branch. All work on the next release happens here so you should generally branch off `develop`. Do **NOT** use this branch for a production site.
- **[master](https://github.com/EOSIO/eosio.token/tree/master)** contains the latest release of eosio.token. This branch may be used in production. Do **NOT** use this branch to work on eosio.token's source.

### Submitting Pull Requests

Expand All @@ -78,7 +78,7 @@ Pull requests are awesome. If you're looking to raise a PR for something which d

Never underestimate just how useful quality assurance is. If you're looking to get involved with the code base and don't know where to start, checking out and testing a pull request is one of the most useful things you could do.

Essentially, [check out the latest develop branch](#working-on-eosio.contracts), take it for a spin, and if you find anything odd, please follow the [bug report guidelines](#bug-reports) and let us know!
Essentially, [check out the latest develop branch](#working-on-eosio.token), take it for a spin, and if you find anything odd, please follow the [bug report guidelines](#bug-reports) and let us know!

## Conduct

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# eosio.token
## Version : 1.9.2
## Version : 2.0.0-rc1

The design of the EOSIO blockchain calls for a number of smart contracts that are run at a privileged permission level in order to support functions such as block producer registration and voting, token staking for CPU and network bandwidth, RAM purchasing, multi-sig, etc. These smart contracts are referred to as the bios, boot, system, msig, wrap (formerly known as sudo) and token contracts.

Expand All @@ -14,7 +14,7 @@ Dependencies:

## Build

To build the contracts follow the instructions in [Build and deploy](https://developers.eos.io/manuals/eosio.token/latest/build-and-deploy) section.
To build the contracts follow the instructions in [Build and deploy](./docs/01_build-and-deploy.md) section.

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion contracts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(contracts)
set(EOSIO_WASM_OLD_BEHAVIOR "Off")
find_package(eosio.cdt)

set(ICON_BASE_URL "http://127.0.0.1/ricardian_assets/eosio.contracts/icons")
set(ICON_BASE_URL "http://127.0.0.1/ricardian_assets/eosio.token/icons")

set(TOKEN_ICON_URI "token.png#207ff68b0406eaa56618b08bda81d6a0954543f36adc328ab3065f31a5c5d654")
set(TRANSFER_ICON_URI "transfer.png#5dfad0df72772ee1ccc155e670c1d124f5c5122f1d5027565df38b418042d1dd")
Expand Down
8 changes: 4 additions & 4 deletions contracts/eosio.token/include/eosio.token/eosio.token.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace eosio {
*
* The `eosio.token` contract class also implements two useful public static methods: `get_supply` and `get_balance`. The first allows one to check the total supply of a specified token, created by an account and the second allows one to check the balance of a token for a specified account (the token creator account has to be specified as well).
*
* The `eosio.token` contract manages the set of tokens, accounts and their corresponding balances, by using two internal multi-index structures: the `accounts` and `stats`. The `accounts` multi-index table holds, for each row, instances of `account` object and the `account` object holds information about the balance of one token. The `accounts` table is scoped to an eosio account, and it keeps the rows indexed based on the token's symbol. This means that when one queries the `accounts` multi-index table for an account name the result is all the tokens that account holds at the moment.
* The `eosio.token` contract manages the set of tokens, accounts and their corresponding balances, by using two internal multi-index structures: the `accounts` and `stats`. The `accounts` multi-index table holds, for each row, instances of `account` object and the `account` object holds information about the balance of one token. The `accounts` table is scoped to an EOSIO account, and it keeps the rows indexed based on the token's symbol. This means that when one queries the `accounts` multi-index table for an account name the result is all the tokens that account holds at the moment.
*
* Similarly, the `stats` multi-index table, holds instances of `currency_stats` objects for each row, which contains information about current supply, maximum supply, and the creator account for a symbol token. The `stats` table is scoped to the token symbol. Therefore, when one queries the `stats` table for a token symbol the result is one single entry/row corresponding to the queried symbol token if it was previously created, or nothing, otherwise.
*/
Expand All @@ -44,7 +44,7 @@ namespace eosio {
* This action issues to `to` account a `quantity` of tokens.
*
* @param to - the account to issue tokens to, it must be the same as the issuer,
* @param quntity - the amount of tokens to be issued,
* @param quantity - the amount of tokens to be issued,
* @memo - the memo string that accompanies the token issue transaction.
*/
[[eosio::action]]
Expand Down Expand Up @@ -104,14 +104,14 @@ namespace eosio {
static asset get_supply( const name& token_contract_account, const symbol_code& sym_code )
{
stats statstable( token_contract_account, sym_code.raw() );
const auto& st = statstable.get( sym_code.raw() );
const auto& st = statstable.get( sym_code.raw(), "invalid supply symbol code" );
return st.supply;
}

static asset get_balance( const name& token_contract_account, const name& owner, const symbol_code& sym_code )
{
accounts accountstable( token_contract_account, owner.value );
const auto& ac = accountstable.get( sym_code.raw() );
const auto& ac = accountstable.get( sym_code.raw(), "no balance with specified symbol" );
return ac.balance;
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/eosio.token/src/eosio.token.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void token::transfer( const name& from,
check( is_account( to ), "to account does not exist");
auto sym = quantity.symbol.code();
stats statstable( get_self(), sym.raw() );
const auto& st = statstable.get( sym.raw() );
const auto& st = statstable.get( sym.raw(), "no balance with specified symbol" );

require_recipient( from );
require_recipient( to );
Expand Down
2 changes: 1 addition & 1 deletion docker/buildContracts.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
set -e # exit on failure of any "simple" command (excludes &&, ||, or | chains)
cd /eosio.contracts
cd /eosio.tokens
./build.sh -c /usr/opt/eosio.cdt -e /opt/eosio -t -y
cd build
tar -pczf /artifacts/contracts.tar.gz *
4 changes: 2 additions & 2 deletions docker/unit-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
set -e # exit on failure of any "simple" command (excludes &&, ||, or | chains)
CPU_CORES=$(getconf _NPROCESSORS_ONLN)
echo "$CPU_CORES cpu cores detected."
cd /eosio.contracts/build/tests
cd /eosio.token/build/tests
TEST_COUNT=$(ctest -N | grep -i 'Total Tests: ' | cut -d ':' -f 2 | awk '{print $1}')
[[ $TEST_COUNT > 0 ]] && echo "$TEST_COUNT tests found." || (echo "ERROR: No tests registered with ctest! Exiting..." && exit 1)
echo "$ ctest -j $CPU_CORES --output-on-failure -T Test"
set +e # defer ctest error handling to end
ctest -j $CPU_CORES --output-on-failure -T Test
EXIT_STATUS=$?
[[ "$EXIT_STATUS" == 0 ]] && set -e
mv /eosio.contracts/build/tests/Testing/$(ls /eosio.contracts/build/tests/Testing/ | grep '20' | tail -n 1)/Test.xml /artifacts/Test.xml
mv /eosio.token/build/tests/Testing/$(ls /eosio.token/build/tests/Testing/ | grep '20' | tail -n 1)/Test.xml /artifacts/Test.xml
# ctest error handling
if [[ "$EXIT_STATUS" != 0 ]]; then
echo "Failing due to non-zero exit status from ctest: $EXIT_STATUS"
Expand Down
6 changes: 3 additions & 3 deletions docker/verifyInstallation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ set -e # exit on failure of any "simple" command (excludes &&, ||, or | chains)
# fail if we didn't find it
[[ -z "$CMAKE_FRAMEWORK_PATH" ]] && exit 1
# export variables
echo "" >> /eosio.contracts/docker/environment.Dockerfile # necessary if there is no '\n' at end of file
echo "ENV CMAKE_FRAMEWORK_PATH=$CMAKE_FRAMEWORK_PATH" >> /eosio.contracts/docker/environment.Dockerfile
echo "ENV EOSIO_ROOT=$CMAKE_FRAMEWORK_PATH" >> /eosio.contracts/docker/environment.Dockerfile
echo "" >> /eosio.token/docker/environment.Dockerfile # necessary if there is no '\n' at end of file
echo "ENV CMAKE_FRAMEWORK_PATH=$CMAKE_FRAMEWORK_PATH" >> /eosio.token/docker/environment.Dockerfile
echo "ENV EOSIO_ROOT=$CMAKE_FRAMEWORK_PATH" >> /eosio.token/docker/environment.Dockerfile
19 changes: 15 additions & 4 deletions docs/03_build-and-deploy.md → docs/01_build-and-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,21 @@ make -j$(sysctl -n hw.ncpu)
cd ..
```

### After build:
* 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__.
* The contracts (both `.wasm` and `.abi` files) are built into their corresponding _build/contracts/\<contract name\>_ folder.
* Finally, simply use __cleos__ to _set contract_ by pointing to the previously mentioned directory for the specific contract.
#### To build the contract and unit tests
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 in section [Building from Sources](https://developers.eos.io/manuals/eos/latest/install/build-from-source).
2. Run the below command to build all the contracts and the unit tests for these contracts.
```
rm -fr build
mkdir build
cd build
cmake -DBUILD_TESTS=true ..
make
```

### After build:
* 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__.
* The contracts (both `.wasm` and `.abi` files) are built into their corresponding _build/contracts/\<contract name\>_ folder.
* Finally, simply use __cleos__ to _set contract_ by pointing to the previously mentioned directory for the specific contract.

# How to deploy the eosio.token

Expand Down
24 changes: 0 additions & 24 deletions docs/01_key-concepts/01_system.md

This file was deleted.

Loading

0 comments on commit 28c46de

Please sign in to comment.