Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"files.associations": {
"chrono": "cpp"
"chrono": "cpp",
"tuple": "cpp"
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# can.contracts

## Version : 1.1.0
## Version : 1.2.0

The design of the CAN 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, system, msig, wrap (formerly known as sudo) and token contracts.

Expand All @@ -16,7 +16,7 @@ The following unprivileged contract(s) are also part of the system.

Dependencies:
* [eosio.cdt v1.7.x](https://github.com/EOSIO/eosio.cdt/releases/tag/v1.7.0)
* [can v2.0.x](https://github.com/canfoundation/CAN/releases/tag/can-v1.0.0) (optional dependency only needed to build unit tests)
* [can v2.0.x](https://github.com/canfoundation/CAN/releases/tag/can-v1.2.0) (optional dependency only needed to build unit tests)

To build the contracts follow the instructions in [`Build and deploy` section](./docs/02_build-and-deploy.md).

Expand Down
11 changes: 6 additions & 5 deletions contracts/eosio.msig/src/eosio.msig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ void multisig::exec( name proposer, name proposal_name, name executer ) {

proposals proptable( get_self(), proposer.value );
auto& prop = proptable.get( proposal_name.value, "proposal not found" );
transaction_header trx_header;
transaction trx;
datastream<const char*> ds( prop.packed_transaction.data(), prop.packed_transaction.size() );
ds >> trx_header;
check( trx_header.expiration >= eosio::time_point_sec(current_time_point()), "transaction expired" );
ds >> trx;
check( trx.expiration >= eosio::time_point_sec(current_time_point()), "transaction expired" );

approvals apptable( get_self(), proposer.value );
auto apps_it = apptable.find( proposal_name.value );
Expand Down Expand Up @@ -180,8 +180,9 @@ void multisig::exec( name proposer, name proposal_name, name executer ) {
);
check( res > 0, "transaction authorization failed" );

send_deferred( (uint128_t(proposer.value) << 64) | proposal_name.value, executer,
prop.packed_transaction.data(), prop.packed_transaction.size() );
for ( auto action: trx.actions ) {
action.send();
}

proptable.erase(prop);
}
Expand Down