-
Notifications
You must be signed in to change notification settings - Fork 58
Payable delegate funcs for possible tip functionality #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4b79d9a
make delegate funcs payable
0xfoobar 02563a7
add slither ignore, add singlesig prototype
0xfoobar 1fd9238
add slither detector ignore to sweep
0xfoobar 0865bf5
two step ownership transfer
0xfoobar 8ac2bee
error code cleanup
0xfoobar 59d978b
add receive and fallback funcs to singlesig
0xfoobar 12e4dfa
use revert strings for broad version and chain explorer compat
0xfoobar fa0d191
add test
0xfoobar c4678d4
remove slither error ignore
0xfoobar 2599b33
gasreport
0xfoobar dc0357c
forge fmt
0xfoobar 220ea09
remove delegatecall from singlesig
0xfoobar 0428ef7
forge update
0xfoobar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -1,24 +1,25 @@ | ||
No files changed, compilation skipped | ||
|
||
Running 1 test for test/GasBenchmark.t.sol:GasBenchmark | ||
[32m[PASS][0m testGas(address,bytes32) (runs: 256, μ: 12620571, ~: 12621045) | ||
Test result: [32mok[0m. 1 passed; 0 failed; finished in 1.15s | ||
[32m[PASS][0m testGas(address,bytes32) (runs: 256, μ: 12884784, ~: 12885163) | ||
Test result: [32mok[0m. 1 passed; 0 failed; 0 skipped; finished in 239.15ms | ||
| src/DelegateRegistry.sol:DelegateRegistry contract | | | | | | | ||
|----------------------------------------------------|-----------------|--------|--------|--------|---------| | ||
| Deployment Cost | Deployment Size | | | | | | ||
| 1804898 | 9047 | | | | | | ||
| 1848948 | 9267 | | | | | | ||
| Function Name | min | avg | median | max | # calls | | ||
| checkDelegateForAll | 2940 | 3151 | 3151 | 3363 | 2 | | ||
| checkDelegateForContract | 5459 | 5897 | 5897 | 6336 | 2 | | ||
| checkDelegateForERC1155 | 8003 | 8715 | 8715 | 9428 | 2 | | ||
| checkDelegateForERC20 | 7942 | 8642 | 8642 | 9343 | 2 | | ||
| checkDelegateForERC721 | 8006 | 8683 | 8683 | 9361 | 2 | | ||
| delegateAll | 135846 | 135846 | 135846 | 135846 | 2 | | ||
| delegateContract | 114436 | 125386 | 125386 | 136336 | 2 | | ||
| delegateERC1155 | 159360 | 170310 | 170310 | 181260 | 2 | | ||
| delegateERC20 | 136909 | 147859 | 147859 | 158809 | 2 | | ||
| delegateERC721 | 136903 | 147853 | 147853 | 158803 | 2 | | ||
| multicall | 689549 | 689549 | 689549 | 689549 | 1 | | ||
| delegateAll | 135800 | 135800 | 135800 | 135800 | 2 | | ||
| delegateContract | 114412 | 125362 | 125362 | 136312 | 2 | | ||
| delegateERC1155 | 159336 | 170286 | 170286 | 181236 | 2 | | ||
| delegateERC20 | 136885 | 147835 | 147835 | 158785 | 2 | | ||
| delegateERC721 | 136879 | 147829 | 147829 | 158779 | 2 | | ||
| multicall | 689383 | 689383 | 689383 | 689383 | 1 | | ||
|
||
|
||
|
||
Ran 1 test suites: 1 tests passed, 0 failed, 0 skipped (1 total tests) |
This file contains hidden or 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
Submodule forge-std
updated
11 files
+2 −0 | src/StdChains.sol | |
+14 −2 | src/StdCheats.sol | |
+41 −14 | src/Vm.sol | |
+93 −77 | test/StdAssertions.t.sol | |
+20 −15 | test/StdChains.t.sol | |
+52 −44 | test/StdCheats.t.sol | |
+10 −10 | test/StdError.t.sol | |
+10 −10 | test/StdMath.t.sol | |
+36 −36 | test/StdStorage.t.sol | |
+4 −4 | test/StdStyle.t.sol | |
+28 −28 | test/StdUtils.t.sol |
Submodule murky
updated
10 files
+1 −1 | .github/workflows/run_tests.yml | |
+21 −0 | LICENSE.txt | |
+9 −0 | README.md | |
+2 −0 | foundry.toml | |
+1 −1 | lib/forge-std | |
+95 −0 | script/Merkle.s.sol | |
+99 −0 | script/common/ScriptHelper.sol | |
+35 −0 | script/target/input.json | |
+72 −0 | script/target/output.json | |
+72 −0 | script/test/Merkle.s.t.sol |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,56 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.4; | ||
|
||
/// @dev This does not include receiver callbacks for "safe" transfer methods of ERC721, ERC1155, etc | ||
contract Singlesig { | ||
address public owner; | ||
address public pendingOwner; | ||
|
||
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); | ||
|
||
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); | ||
|
||
/// @dev Initializes the contract setting the address provided by the deployer as the initial owner | ||
/// @dev Distinct constructor args will lead to distinct CREATE2 deployment bytecode, so no collision risk here | ||
constructor(address initialOwner) { | ||
owner = initialOwner; | ||
emit OwnershipTransferred(address(0), initialOwner); | ||
} | ||
|
||
// @dev Function to receive Ether. msg.data must be empty | ||
receive() external payable {} | ||
|
||
// @dev Fallback function is called when msg.data is not empty | ||
fallback() external payable {} | ||
|
||
/// @dev Throws if called by any account other than the owner | ||
modifier onlyOwner() { | ||
require(owner == msg.sender, "Ownable2Step: caller is not the owner"); | ||
_; | ||
} | ||
|
||
/// @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one | ||
function transferOwnership(address newOwner) external onlyOwner { | ||
pendingOwner = newOwner; | ||
emit OwnershipTransferStarted(owner, newOwner); | ||
} | ||
|
||
/// @dev The new owner accepts the ownership transfer | ||
function acceptOwnership() external { | ||
require(pendingOwner == msg.sender, "Ownable2Step: caller is not the new owner"); | ||
emit OwnershipTransferred(owner, pendingOwner); | ||
owner = pendingOwner; | ||
} | ||
|
||
/** | ||
* @notice Executes a call with provided parameters | ||
* @dev This method doesn't perform any sanity check of the transaction | ||
* @param to Destination address | ||
* @param value Ether value in wei | ||
* @param data Data payload | ||
* @return success Boolean flag indicating if the call succeeded | ||
*/ | ||
function execute(address to, uint256 value, bytes memory data) public onlyOwner returns (bool success) { | ||
(success,) = to.call{value: value}(data); | ||
} | ||
} |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.