-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop interfaces token structure (#173)
* new drop interface structure * update gitignore * update docs * add our own Multicall extension * dev build
- Loading branch information
1 parent
f544ef1
commit 5d74f29
Showing
21 changed files
with
606 additions
and
36,034 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
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,25 @@ | ||
// SPDX-License-Identifier: MIT | ||
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Multicall.sol) | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import "../lib/TWAddress.sol"; | ||
import "./interface/IMulticall.sol"; | ||
|
||
/** | ||
* @dev Provides a function to batch together multiple calls in a single external call. | ||
* | ||
* _Available since v4.1._ | ||
*/ | ||
contract Multicall is IMulticall { | ||
/** | ||
* @dev Receives and executes a batch of function calls on this contract. | ||
*/ | ||
function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) { | ||
results = new bytes[](data.length); | ||
for (uint256 i = 0; i < data.length; i++) { | ||
results[i] = TWAddress.functionDelegateCall(address(this), data[i]); | ||
} | ||
return results; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
contracts/feature/interface/IClaimConditionsMultiPhase.sol
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,29 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.0; | ||
|
||
import "../../lib/TWBitMaps.sol"; | ||
import "./IClaimCondition.sol"; | ||
|
||
/** | ||
* Thirdweb's 'Drop' contracts are distribution mechanisms for tokens. | ||
* | ||
* A contract admin (i.e. a holder of `DEFAULT_ADMIN_ROLE`) can set a series of claim conditions, | ||
* ordered by their respective `startTimestamp`. A claim condition defines criteria under which | ||
* accounts can mint tokens. Claim conditions can be overwritten or added to by the contract admin. | ||
* At any moment, there is only one active claim condition. | ||
*/ | ||
|
||
interface IClaimConditionsMultiPhase is IClaimCondition { | ||
event ClaimConditionsUpdated(ClaimCondition[] claimConditions); | ||
|
||
/** | ||
* @notice Lets a contract admin (account with `DEFAULT_ADMIN_ROLE`) set claim conditions. | ||
* | ||
* @param phases Claim conditions in ascending order by `startTimestamp`. | ||
* | ||
* @param resetClaimEligibility Whether to reset `limitLastClaimTimestamp` and `limitMerkleProofClaim` values when setting new | ||
* claim conditions. | ||
* | ||
*/ | ||
function setClaimConditions(ClaimCondition[] calldata phases, bool resetClaimEligibility) external; | ||
} |
29 changes: 29 additions & 0 deletions
29
contracts/feature/interface/IClaimConditionsSinglePhase.sol
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,29 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.0; | ||
|
||
import "../../lib/TWBitMaps.sol"; | ||
import "./IClaimCondition.sol"; | ||
|
||
/** | ||
* Thirdweb's 'Drop' contracts are distribution mechanisms for tokens. | ||
* | ||
* A contract admin (i.e. a holder of `DEFAULT_ADMIN_ROLE`) can set a series of claim conditions, | ||
* ordered by their respective `startTimestamp`. A claim condition defines criteria under which | ||
* accounts can mint tokens. Claim conditions can be overwritten or added to by the contract admin. | ||
* At any moment, there is only one active claim condition. | ||
*/ | ||
|
||
interface IClaimConditionsSinglePhase is IClaimCondition { | ||
event ClaimConditionUpdated(ClaimCondition claimConditions, bool resetClaimEligibility); | ||
|
||
/** | ||
* @notice Lets a contract admin (account with `DEFAULT_ADMIN_ROLE`) set claim conditions. | ||
* | ||
* @param phase Claim conditions in ascending order by `startTimestamp`. | ||
* | ||
* @param resetClaimEligibility Whether to reset `limitLastClaimTimestamp` and `limitMerkleProofClaim` values when setting new | ||
* claim conditions. | ||
* | ||
*/ | ||
function setClaimConditions(ClaimCondition calldata phase, bool resetClaimEligibility) external; | ||
} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.