diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b3b53783..640e8284f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## [unreleased] - mock: Update `method_names` field of `AddKeyWithFunctionCall` to a `Vec` from `Vec>`. [PR 555](https://github.com/near/near-sdk-rs/pull/555) - Method names were changed to be strings in `4.0.0-pre.2` but this one was missed +- env: Update the register used for temporary `env` methods to `u64::MAX - 2` from `0`. [PR 557](https://github.com/near/near-sdk-rs/pull/489). + - When mixing using `sys` and `env`, reduces chance of collision for using `0` ## `4.0.0-pre.2` [08-19-2021] - Update `panic` and `panic_utf8` syscall signatures to indicate they do not return. [PR 489](https://github.com/near/near-sdk-rs/pull/489) diff --git a/examples/cross-contract-high-level/res/cross_contract_high_level.wasm b/examples/cross-contract-high-level/res/cross_contract_high_level.wasm index 8c788c890..911b05c20 100755 Binary files a/examples/cross-contract-high-level/res/cross_contract_high_level.wasm and b/examples/cross-contract-high-level/res/cross_contract_high_level.wasm differ diff --git a/examples/cross-contract-low-level/res/cross_contract_low_level.wasm b/examples/cross-contract-low-level/res/cross_contract_low_level.wasm index 8b76a21c1..af3ec197f 100755 Binary files a/examples/cross-contract-low-level/res/cross_contract_low_level.wasm and b/examples/cross-contract-low-level/res/cross_contract_low_level.wasm differ diff --git a/examples/fungible-token/res/defi.wasm b/examples/fungible-token/res/defi.wasm index 07413e177..b38800cd4 100755 Binary files a/examples/fungible-token/res/defi.wasm and b/examples/fungible-token/res/defi.wasm differ diff --git a/examples/fungible-token/res/fungible_token.wasm b/examples/fungible-token/res/fungible_token.wasm index 3e9948176..ebdb2b1b2 100755 Binary files a/examples/fungible-token/res/fungible_token.wasm and b/examples/fungible-token/res/fungible_token.wasm differ diff --git a/examples/gas-fee-tester/res/gas_fee_tester.wasm b/examples/gas-fee-tester/res/gas_fee_tester.wasm index 5c2d89970..c63eb2cb6 100755 Binary files a/examples/gas-fee-tester/res/gas_fee_tester.wasm and b/examples/gas-fee-tester/res/gas_fee_tester.wasm differ diff --git a/examples/lockable-fungible-token/res/lockable_fungible_token.wasm b/examples/lockable-fungible-token/res/lockable_fungible_token.wasm index c6f5a2362..3ec1c3cf2 100755 Binary files a/examples/lockable-fungible-token/res/lockable_fungible_token.wasm and b/examples/lockable-fungible-token/res/lockable_fungible_token.wasm differ diff --git a/examples/mission-control/res/mission_control.wasm b/examples/mission-control/res/mission_control.wasm index 9ae98daab..2c170729d 100755 Binary files a/examples/mission-control/res/mission_control.wasm and b/examples/mission-control/res/mission_control.wasm differ diff --git a/examples/non-fungible-token/res/approval_receiver.wasm b/examples/non-fungible-token/res/approval_receiver.wasm index 3fe2036c5..4142e319a 100755 Binary files a/examples/non-fungible-token/res/approval_receiver.wasm and b/examples/non-fungible-token/res/approval_receiver.wasm differ diff --git a/examples/non-fungible-token/res/non_fungible_token.wasm b/examples/non-fungible-token/res/non_fungible_token.wasm index 86e747dec..f2364134a 100755 Binary files a/examples/non-fungible-token/res/non_fungible_token.wasm and b/examples/non-fungible-token/res/non_fungible_token.wasm differ diff --git a/examples/non-fungible-token/res/token_receiver.wasm b/examples/non-fungible-token/res/token_receiver.wasm index f4e03bc95..36386e377 100755 Binary files a/examples/non-fungible-token/res/token_receiver.wasm and b/examples/non-fungible-token/res/token_receiver.wasm differ diff --git a/examples/status-message-collections/res/status_message_collections.wasm b/examples/status-message-collections/res/status_message_collections.wasm index ceb772464..75e1f3191 100755 Binary files a/examples/status-message-collections/res/status_message_collections.wasm and b/examples/status-message-collections/res/status_message_collections.wasm differ diff --git a/examples/status-message/res/status_message.wasm b/examples/status-message/res/status_message.wasm index 5849a7127..cf81d2146 100755 Binary files a/examples/status-message/res/status_message.wasm and b/examples/status-message/res/status_message.wasm differ diff --git a/examples/test-contract/res/test_contract.wasm b/examples/test-contract/res/test_contract.wasm index 3a10f4eea..ccb344ddd 100755 Binary files a/examples/test-contract/res/test_contract.wasm and b/examples/test-contract/res/test_contract.wasm differ diff --git a/near-sdk/src/environment/env.rs b/near-sdk/src/environment/env.rs index 8a4a1a73f..ccdeea112 100644 --- a/near-sdk/src/environment/env.rs +++ b/near-sdk/src/environment/env.rs @@ -20,7 +20,7 @@ const REGISTER_EXPECTED_ERR: &str = /// Register used internally for atomic operations. This register is safe to use by the user, /// since it only needs to be untouched while methods of `Environment` execute, which is guaranteed /// guest code is not parallel. -const ATOMIC_OP_REGISTER: u64 = 0; +const ATOMIC_OP_REGISTER: u64 = std::u64::MAX - 2; /// Register used to record evicted values from the storage. const EVICTED_REGISTER: u64 = std::u64::MAX - 1;