mirror of
https://github.com/cerc-io/watcher-ts
synced 2024-11-19 20:36:19 +00:00
bd73dae1b1
* Add Consensus class with placeholders * Implement Consensus constructor * Move PubsubType to peer package * Implement remaining methods in Consensus class * Use existing consensus stream if it exists * Setup send and receive pipes on consensus streams * Refactor P2P and consensus setup in server command * Add Nitro node initialization in server command * Return objects from server initializations * Use dynamic imports for ES modules in util package * Fix util deps * Change target to es6 to allow creating a Mokka instance * Set moduleResolution to node16 in util for dynamic imports * Upgrade @cerc-io/nitro-node package * Implement retries while sending consensus messages * Use bunyan for consensus logs and subscribe to state changes * Use debug for logging state change events * Handle empty watcher party file path * Return object from initP2P * Upgrade @cerc-io/nitro-node package * Update package versions |
||
---|---|---|
.. | ||
src | ||
test | ||
.env.example | ||
.eslintignore | ||
.eslintrc.json | ||
.gitignore | ||
.npmignore | ||
hardhat.config.ts | ||
package.json | ||
README.md | ||
tsconfig.json |
solidity-mapper
Get value of state variable from storage for a solidity contract.
Pre-requisites
-
NodeJS and NPM
Instructions
-
Create environment variable file
$ cp .env.example .env
-
Run the tests using the following command
$ yarn test # For testing on private network using RPC getStorageAt. # Set ETH_RPC_URL in .env $ yarn test:geth-rpc # For testing on private network using ipld-eth-client getStorageAt. # Set GQL_ENDPOINT in .env $ yarn test:ipld-gql
Different Types
- Value Types
- Booleans
- Integers
- Fixed Point Numbers
- Address
- Contract Types
- Fixed-size byte arrays
- Enums
- Function Types
- Reference Types
- Arrays
- Get all elements in array
- Get element in array by index
- Fixed size arrays
- Integer Type
- Boolean Type
- Address Type
- Fixed-size byte arrays
- Enum type
- Dynamically-sized byte array
- Struct Type
- Mapping Type
- Dynamically-sized arrays
- Integer Type
- Boolean Type
- Address Type
- Fixed-size byte arrays
- Enum Type
- Dynamically-sized byte array
- Struct Type
- Mapping Type
- Nested Arrays
- Fixed size arrays
- Dynamically-sized arrays
- Dynamically-sized byte array
- Bytes
- String
- Structs
- Get struct value with all members
- Value Types
- Get value of a single member in struct
- Reference Types
- Struct type members (nested)
- Fixed size Array members
- Dynamically sized Array members
- Bytes and string type members
- Mapping type members
- Mapping Types
- Value Type keys
- Fixed-size byte array keys
- Dynamically-sized byte array keys
- Reference Type Mapping values
- Struct type values
- Array type values
- Dynamically sized Bytes and string type values
- Nested Mapping
- Arrays
Observations
-
The storage layouts are formed according to the rules in https://docs.soliditylang.org/en/latest/internals/layout_in_storage.html#layout-of-state-variables-in-storage
-
Structs can occupy multiple slots depending on the size required by its members.
-
Fixed arrays can occupy multiple slots according to the size of the array and the type of array.