-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chg: Modify the RegisterHelper contract to support transferring eth t…
…o the contract
- Loading branch information
Showing
6 changed files
with
88 additions
and
30 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,24 +1,24 @@ | ||
{ | ||
"name": "union-referral", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"directories": { | ||
"lib": "lib", | ||
"test": "test" | ||
}, | ||
"scripts": { | ||
"test": "forge test -vvv", | ||
"compile": "forge build" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/unioncredit/union-referral.git" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/unioncredit/union-referral/issues" | ||
}, | ||
"homepage": "https://github.com/unioncredit/union-referral#readme" | ||
"name": "union-referral", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"directories": { | ||
"lib": "lib", | ||
"test": "test" | ||
}, | ||
"scripts": { | ||
"test": "forge test -vv", | ||
"compile": "forge build" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/unioncredit/union-referral.git" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/unioncredit/union-referral/issues" | ||
}, | ||
"homepage": "https://github.com/unioncredit/union-referral#readme" | ||
} |
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
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,48 @@ | ||
/** | ||
*Submitted for verification at Optimistic.Etherscan.io on 2021-12-21 | ||
*/ | ||
|
||
// SPDX-License-Identifier: LGPL-3.0-only | ||
pragma solidity 0.8.19; | ||
|
||
/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain | ||
/// @author Richard Meissner - <[email protected]> | ||
interface IProxy { | ||
function masterCopy() external view returns (address); | ||
} | ||
|
||
/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract. | ||
/// @author Stefan George - <[email protected]> | ||
/// @author Richard Meissner - <[email protected]> | ||
contract GnosisSafeProxyMock { | ||
// singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated. | ||
// To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt` | ||
address internal singleton; | ||
|
||
/// @dev Constructor function sets address of singleton contract. | ||
/// @param _singleton Singleton address. | ||
constructor(address _singleton) { | ||
require(_singleton != address(0), "Invalid singleton address provided"); | ||
singleton = _singleton; | ||
} | ||
|
||
/// @dev Fallback function forwards all transactions and returns all received return data. | ||
fallback() external payable { | ||
// solhint-disable-next-line no-inline-assembly | ||
assembly { | ||
let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff) | ||
// 0xa619486e == keccak("masterCopy()"). The value is right padded to 32-bytes with 0s | ||
if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) { | ||
mstore(0, _singleton) | ||
return(0, 0x20) | ||
} | ||
calldatacopy(0, 0, calldatasize()) | ||
let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0) | ||
returndatacopy(0, 0, returndatasize()) | ||
if eq(success, 0) { | ||
revert(0, returndatasize()) | ||
} | ||
return(0, returndatasize()) | ||
} | ||
} | ||
} |
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
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