-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #153 from hackdays-io/add_upgradable
BigBangコントラクトをupgradableに対応させました。
- Loading branch information
Showing
15 changed files
with
766 additions
and
401 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// SPDX-License-Identifier: MIT | ||
// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol) | ||
|
||
pragma solidity ^0.8.24; | ||
|
||
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; | ||
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; | ||
|
||
/** | ||
* @dev Context variant with ERC2771 support. | ||
*/ | ||
abstract contract ERC2771ContextUpgradeable is | ||
Initializable, | ||
ContextUpgradeable | ||
{ | ||
address private _trustedForwarder; | ||
|
||
function __ERC2771Context_init(address trustedForwarder) | ||
internal | ||
onlyInitializing | ||
{ | ||
__Context_init_unchained(); | ||
_trustedForwarder = trustedForwarder; | ||
} | ||
|
||
function isTrustedForwarder(address forwarder) | ||
public | ||
view | ||
virtual | ||
returns (bool) | ||
{ | ||
return forwarder == _trustedForwarder; | ||
} | ||
|
||
function _msgSender() | ||
internal | ||
view | ||
virtual | ||
override | ||
returns (address sender) | ||
{ | ||
if (isTrustedForwarder(msg.sender)) { | ||
// The assembly code is more direct than the Solidity version using `abi.decode`. | ||
/// @solidity memory-safe-assembly | ||
assembly { | ||
sender := shr(96, calldataload(sub(calldatasize(), 20))) | ||
} | ||
} else { | ||
return super._msgSender(); | ||
} | ||
} | ||
|
||
function _msgData() | ||
internal | ||
view | ||
virtual | ||
override | ||
returns (bytes calldata) | ||
{ | ||
if (isTrustedForwarder(msg.sender)) { | ||
return msg.data[:msg.data.length - 20]; | ||
} else { | ||
return super._msgData(); | ||
} | ||
} | ||
|
||
/** | ||
* @dev This empty reserved space is put in place to allow future versions to add new | ||
* variables without shifting down storage in the inheritance chain. | ||
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps | ||
*/ | ||
uint256[50] private __gap; | ||
} |
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
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,31 +1,39 @@ | ||
·------------------------|----------------------------|-------------|-----------------------------· | ||
| Solc version: 0.8.24 · Optimizer enabled: false · Runs: 200 · Block limit: 30000000 gas │ | ||
·························|····························|·············|······························ | ||
| Methods │ | ||
··············|··········|··············|·············|·············|···············|·············· | ||
| Contract · Method · Min · Max · Avg · # calls · usd (avg) │ | ||
··············|··········|··············|·············|·············|···············|·············· | ||
| Deployments · · % of limit · │ | ||
·························|··············|·············|·············|···············|·············· | ||
| BigBang · 1092017 · 1092029 · 1092023 · 3.6 % · - │ | ||
·························|··············|·············|·············|···············|·············· | ||
| FractionToken · - · - · 2573797 · 8.6 % · - │ | ||
·························|··············|·············|·············|···············|·············· | ||
| Hats · - · - · 7032431 · 23.4 % · - │ | ||
·························|··············|·············|·············|···············|·············· | ||
| HatsModule · - · - · 754132 · 2.5 % · - │ | ||
·························|··············|·············|·············|···············|·············· | ||
| HatsModuleFactory · - · - · 1101122 · 3.7 % · - │ | ||
·························|··············|·············|·············|···············|·············· | ||
| HatsTimeFrameModule · - · - · 1287099 · 4.3 % · - │ | ||
·························|··············|·············|·············|···············|·············· | ||
| PullSplitFactory · - · - · 4535827 · 15.1 % · - │ | ||
·························|··············|·············|·············|···············|·············· | ||
| PushSplitFactory · - · - · 4483113 · 14.9 % · - │ | ||
·························|··············|·············|·············|···············|·············· | ||
| SplitsCreator · - · - · 1487532 · 5 % · - │ | ||
·························|··············|·············|·············|···············|·············· | ||
| SplitsCreatorFactory · - · - · 526836 · 1.8 % · - │ | ||
·························|··············|·············|·············|···············|·············· | ||
| SplitsWarehouse · - · - · 3934655 · 13.1 % · - │ | ||
·------------------------|--------------|-------------|-------------|---------------|-------------· | ||
·--------------------------------------|----------------------------|-------------|-----------------------------· | ||
| Solc version: 0.8.24 · Optimizer enabled: false · Runs: 200 · Block limit: 30000000 gas │ | ||
·······································|····························|·············|······························ | ||
| Methods │ | ||
··················|····················|··············|·············|·············|···············|·············· | ||
| Contract · Method · Min · Max · Avg · # calls · usd (avg) │ | ||
··················|····················|··············|·············|·············|···············|·············· | ||
| BigBang · bigbang · - · - · 603669 · 2 · - │ | ||
··················|····················|··············|·············|·············|···············|·············· | ||
| FractionToken · burn · 41544 · 55511 · 47442 · 4 · - │ | ||
··················|····················|··············|·············|·············|···············|·············· | ||
| FractionToken · mint · 135046 · 137558 · 136717 · 9 · - │ | ||
··················|····················|··············|·············|·············|···············|·············· | ||
| FractionToken · safeTransferFrom · 106335 · 106347 · 106339 · 3 · - │ | ||
··················|····················|··············|·············|·············|···············|·············· | ||
| Deployments · · % of limit · │ | ||
·······································|··············|·············|·············|···············|·············· | ||
| BigBang · - · - · 1248128 · 4.2 % · - │ | ||
·······································|··············|·············|·············|···············|·············· | ||
| FractionToken · - · - · 2859199 · 9.5 % · - │ | ||
·······································|··············|·············|·············|···············|·············· | ||
| Hats · - · - · 7032431 · 23.4 % · - │ | ||
·······································|··············|·············|·············|···············|·············· | ||
| HatsModule · - · - · 754132 · 2.5 % · - │ | ||
·······································|··············|·············|·············|···············|·············· | ||
| HatsModuleFactory · - · - · 1101122 · 3.7 % · - │ | ||
·······································|··············|·············|·············|···············|·············· | ||
| HatsTimeFrameModule · - · - · 1287099 · 4.3 % · - │ | ||
·······································|··············|·············|·············|···············|·············· | ||
| PullSplitFactory · - · - · 4535827 · 15.1 % · - │ | ||
·······································|··············|·············|·············|···············|·············· | ||
| PushSplitFactory · - · - · 4483113 · 14.9 % · - │ | ||
·······································|··············|·············|·············|···············|·············· | ||
| SplitsCreator · - · - · 1487532 · 5 % · - │ | ||
·······································|··············|·············|·············|···············|·············· | ||
| SplitsCreatorFactory · - · - · 526836 · 1.8 % · - │ | ||
·······································|··············|·············|·············|···············|·············· | ||
| SplitsWarehouse · - · - · 3934655 · 13.1 % · - │ | ||
·--------------------------------------|--------------|-------------|-------------|---------------|-------------· |
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
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
Oops, something went wrong.