-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable eth_call state override (#2219)
- Loading branch information
Showing
5 changed files
with
5,401 additions
and
23 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
pragma solidity >=0.8.0; | ||
|
||
/// @notice Smart contract to help test state override | ||
contract StateOverrideTest { | ||
/// @notice The maxmium allowed value | ||
uint256 public MAX_ALLOWED = 3; | ||
uint256 public availableFunds; | ||
mapping(address => mapping(address => uint256)) public allowance; | ||
|
||
address owner; | ||
|
||
constructor(uint256 intialAmount) payable { | ||
owner = msg.sender; | ||
availableFunds = intialAmount; | ||
} | ||
|
||
function getBalance() external view returns (uint256) { | ||
return address(this).balance; | ||
} | ||
|
||
function getSenderBalance() external view returns (uint256) { | ||
return address(msg.sender).balance; | ||
} | ||
|
||
function getAllowance(address from, address who) | ||
external | ||
view | ||
returns (uint256) | ||
{ | ||
return allowance[from][who]; | ||
} | ||
|
||
function setAllowance(address who, uint256 amount) external { | ||
allowance[address(msg.sender)][who] = amount; | ||
} | ||
} |
Oops, something went wrong.