Skip to content

Commit

Permalink
BTT BurnToClaimDropERC721 and extensions (#509)
Browse files Browse the repository at this point in the history
* test verifyBurnToClaim

* Fix [Q-2] Missing sanity check when setting BurnToClaimInfo

* test setBurnToClaimInfo

* fix tests

* test _burnTokensOnOrigin

* test _burnTokensOnOrigin

* test verifyClaim

* test wallet random

* test setClaimConditions

* test getActiveClaimConditionId

* make verifyClaim virtual

* test claim

* test setContractURI

* update as per latest audit for burn-to-claim

* test royalty extension

* test ownable extension

* test delayed-reveal extension

* test batch-mint-metadata extension

* test lazy-mint extension

* test initialize burn-to-claim

* test other functions burn-to-claim

* test lazyMint main contract

* test burnAndClaim main contract

* test reveal main contract

* other function tests

* mark checked

* other function tests

* fix

* fix

---------

Co-authored-by: Krishang <krishang@thirdweb.com>
Co-authored-by: Joaquim Verges <joaquim.verges@gmail.com>
  • Loading branch information
3 people authored Oct 16, 2023
1 parent 4cc7fc5 commit 987c765
Show file tree
Hide file tree
Showing 108 changed files with 9,735 additions and 22 deletions.
4 changes: 4 additions & 0 deletions contracts/extension/BurnToClaim.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import "./interface/IBurnToClaim.sol";
abstract contract BurnToClaim is IBurnToClaim {
BurnToClaimInfo internal burnToClaimInfo;

function getBurnToClaimInfo() public view returns (BurnToClaimInfo memory) {
return burnToClaimInfo;
}

function setBurnToClaimInfo(BurnToClaimInfo calldata _burnToClaimInfo) external virtual {
require(_canSetBurnToClaim(), "Not authorized.");
require(_burnToClaimInfo.originContractAddress != address(0), "Origin contract not set.");
Expand Down
2 changes: 1 addition & 1 deletion contracts/extension/Drop.sol
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ abstract contract Drop is IDrop {
address _currency,
uint256 _pricePerToken,
AllowlistProof calldata _allowlistProof
) public view returns (bool isOverride) {
) public view virtual returns (bool isOverride) {
ClaimCondition memory currentClaimPhase = claimCondition.conditions[_conditionId];
uint256 claimLimit = currentClaimPhase.quantityLimitPerWallet;
uint256 claimPrice = currentClaimPhase.pricePerToken;
Expand Down
2 changes: 1 addition & 1 deletion contracts/extension/Drop1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ abstract contract Drop1155 is IDrop1155 {
address _currency,
uint256 _pricePerToken,
AllowlistProof calldata _allowlistProof
) public view returns (bool isOverride) {
) public view virtual returns (bool isOverride) {
ClaimCondition memory currentClaimPhase = claimCondition[_tokenId].conditions[_conditionId];
uint256 claimLimit = currentClaimPhase.quantityLimitPerWallet;
uint256 claimPrice = currentClaimPhase.pricePerToken;
Expand Down
2 changes: 1 addition & 1 deletion contracts/extension/DropSinglePhase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ abstract contract DropSinglePhase is IDropSinglePhase {
address _currency,
uint256 _pricePerToken,
AllowlistProof calldata _allowlistProof
) public view returns (bool isOverride) {
) public view virtual returns (bool isOverride) {
ClaimCondition memory currentClaimPhase = claimCondition;
uint256 claimLimit = currentClaimPhase.quantityLimitPerWallet;
uint256 claimPrice = currentClaimPhase.pricePerToken;
Expand Down
2 changes: 1 addition & 1 deletion contracts/extension/DropSinglePhase1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ abstract contract DropSinglePhase1155 is IDropSinglePhase1155 {
address _currency,
uint256 _pricePerToken,
AllowlistProof calldata _allowlistProof
) public view returns (bool isOverride) {
) public view virtual returns (bool isOverride) {
ClaimCondition memory currentClaimPhase = claimCondition[_tokenId];
uint256 claimLimit = currentClaimPhase.quantityLimitPerWallet;
uint256 claimPrice = currentClaimPhase.pricePerToken;
Expand Down
2 changes: 1 addition & 1 deletion contracts/extension/upgradeable/Drop.sol
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ abstract contract Drop is IDrop {
address _currency,
uint256 _pricePerToken,
AllowlistProof calldata _allowlistProof
) public view returns (bool isOverride) {
) public view virtual returns (bool isOverride) {
ClaimCondition memory currentClaimPhase = _dropStorage().claimCondition.conditions[_conditionId];
uint256 claimLimit = currentClaimPhase.quantityLimitPerWallet;
uint256 claimPrice = currentClaimPhase.pricePerToken;
Expand Down
Loading

0 comments on commit 987c765

Please sign in to comment.