Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brockelmore/HEVMHelpers
https://github.com/brockelmore/HEVMHelpers
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/brockelmore/HEVMHelpers
- Owner: brockelmore
- Created: 2020-10-01T22:08:40.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-08T03:09:12.000Z (over 3 years ago)
- Last Synced: 2024-04-06T07:34:39.889Z (7 months ago)
- Language: Solidity
- Size: 12.7 KB
- Stars: 48
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-smart-contract-development - HEVM Helpers
- awesome-dapptools - HEVMHelpers
README
# HEVM Helpers
This library is intended for use with HEVM from dapphub. It enables writing to arbitrary contract's storage, targeted by a specific function.
Effectively: this allows you to set an arbitrary value like `balanceOf` of any contract, without knowing storage layout. i.e.:
```
function write_balanceOf(address who, address acct, uint256 value) public {
write_map(who, "balanceOf(address)", acct, value);
}
function write_balanceOfUnderlying(address who, address acct, uint256 value) public {
write_map(who, "balanceOfUnderlying(address)", acct, value);
}
function write_totalSupply(address who, uint256 value) public {
write_flat(who, "totalSupply()", value);
}
```It supports multi-key `mapping` via: ```write_deep_map(address who, string memory sig, bytes32[] memory keys, address value)```. It has some limitations around structs.