Skip to content

Commit 356832d

Browse files
committed
wip
1 parent ac1d0e0 commit 356832d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cosmwasm/cw-manager/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@
3838
//! Since all the permissions of the managed system can be modified by the admins of this instance,
3939
//! it is expected that they will be highly secured (e.g., a multisig or a well-configured DAO).
4040
//!
41+
//! # Changes from original implementation
42+
//!
43+
//! This implementation attempts to be a faithful, 1:1 reimplementation of the original solidity source code. There are however some instances where this is not possible, due to fundamental differences between the EVM and `CosmWasm`:
44+
//!
45+
//! - Storage in `CosmWasm` functions quite differently than in the EVM. In solidity, it is possible to embed a mapping directly in a struct that is stored in storage, which allows for multi-level deferred storage access. To emulate this behaviour in `CosmWasm`, a separate storage item is used explicitly in these cases. See the [`state`] and [`types`] modules for examples.
46+
//! - `CosmWasm` does not allow for synchronous cross-contract calls, and instead uses a submessage/reply pattern. As such, nested executions can not be run inline. In the original solidity implementation, `_executionId` is used to track the currently executing call, which is set immediately before executing the subcall and reset immediately after it. To emulate this behaviour in `CosmWasm`, we instead use a list (see [`ExecutionIdStack`][crate::state::ExecutionIdStack]) and pop the id in the reply handler.
47+
//! - Solidity calldata is arbitrary bytes, and selectors are `bytes4`. Since `CosmWasm` instead uses JSON for it's data transfer format with the `ExecuteMsg`/`QueryMsg` enum pattern, calldata in this implementation is JSON, and selectors are strings. See [`managed`] for more information.
48+
//!
4149
//! [am]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.4.0/contracts/access/manager/AccessManager.sol
4250
4351
#![warn(clippy::pedantic)]

0 commit comments

Comments
 (0)