Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/warifp/swisstronik-eth-getstorage
Swisstronik ETH getStorage. In this project, there are sample contracts, tests, and scripts that deploy contracts, as well as the Swisstronik blockchain network. This case demonstrates the basic usage of Hardhat.
https://github.com/warifp/swisstronik-eth-getstorage
blockchain hardhat smart-contract storage swisstronik
Last synced: 25 days ago
JSON representation
Swisstronik ETH getStorage. In this project, there are sample contracts, tests, and scripts that deploy contracts, as well as the Swisstronik blockchain network. This case demonstrates the basic usage of Hardhat.
- Host: GitHub
- URL: https://github.com/warifp/swisstronik-eth-getstorage
- Owner: warifp
- Created: 2023-09-20T18:46:33.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-09T02:15:03.000Z (3 months ago)
- Last Synced: 2024-10-14T22:09:05.375Z (2 months ago)
- Topics: blockchain, hardhat, smart-contract, storage, swisstronik
- Language: JavaScript
- Homepage:
- Size: 165 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Swisstronik ETH getStorage
In this project, there are sample contracts, tests, and scripts that deploy contracts, as well as the Swisstronik blockchain network. This case demonstrates the basic usage of Hardhat.
## Task
Make a JSON RPC call using eth_getStorageAt() to get the first storage variable (slot #0) of any deployed smart contract and explain what is the retrieved value or if there is any difference with other blockchains when using this RPC method.
## Usage
Installation Package
```
npm install
```### Network: Swisstronik
#### `Request`
```shell
npx hardhat run scripts/getStorage.js --network swisstronik
```#### `Response`
```shell
{
contract: '0xf84Df872D385997aBc28E3f07A2E3cd707c9698a',
slotNumber: 0,
rpcURL: 'https://json-rpc.testnet.swisstronik.com/'
}Response:
Storage Value at Slot 0: 0x0xc73e7f645a2bf1365a0903afa03a2cb5029ba989df7844b0fe7751b1ba918ea4
```### Network: Ethereum Sepolia
#### `Request`
```shell
npx hardhat run scripts/getStorage.js --network sepolia
```#### `Response`
```shell
{
contract: '0xf84Df872D385997aBc28E3f07A2E3cd707c9698a',
slotNumber: 0,
rpcURL: 'https://rpc.sepolia.org'
}Response:
Storage Value at Slot 0: 0x0x0000000000000000000000000000000000000000000000000000000000000000
```### Network: Polygon Mumbai
#### `Request`
```shell
npx hardhat run scripts/getStorage.js --network mumbai
```#### `Response`
```shell
{
contract: '0xf84Df872D385997aBc28E3f07A2E3cd707c9698a',
slotNumber: 0,
rpcURL: 'https://polygon-mumbai.blockpi.network/v1/rpc/public'
}Response:
Storage Value at Slot 0: 0x0x0000000000000000000000000000000000000000000000000000000000000000
```## Smart Contract
```
0xf84Df872D385997aBc28E3f07A2E3cd707c9698a
```## Conclusion
Here I use the ethers v6 package. and the difference between the Ethers v5 and v6 packages is in the Get Storage Function
`Ethers v5`
```
getStorageAt()
````Ethers v6`
```
getStorage()
```