Skip to content

Commit

Permalink
Merge branch 'main' into yash/sync-extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrishang authored Oct 16, 2023
2 parents db76424 + 9ce0b55 commit a001aa5
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion contracts/prebuilts/account/interface/IEntrypoint.sol
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ interface IEntryPoint is IStakeManager, INonceManager {
* it performs full validation of the UserOperation, but ignores signature error.
* an optional target address is called after the userop succeeds, and its value is returned
* (before the entire call is reverted)
* Note that in order to collect the the success/failure of the target call, it must be executed
* Note that in order to collect the success/failure of the target call, it must be executed
* with trace enabled to track the emitted events.
* @param op the UserOperation to simulate
* @param target if nonzero, a target address to call after userop simulation. If called, the targetSuccess and targetResult
Expand Down
4 changes: 2 additions & 2 deletions contracts/prebuilts/drop/drop.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ There are a few key differences between the three implementations —

The distribution mechanism of thirdweb’s `Drop` contracts is vulnerable to [sybil attacks](https://en.wikipedia.org/wiki/Sybil_attack). That is, despite the various ways in which restrictions can be applied to the minting of tokens, some restrictions that claim conditions can express target wallets and not persons.

For example, the restriction `quantityLimitPerWallet` expresses the max quantity a _wallet_ can claim during the respective claim condition. A sophisticated actor may generate multiple wallets to claim tokens in a way that undermine such restrictions, when viewing such restrictions as restrictions on unique persons, and not wallets.
For example, the restriction `quantityLimitPerWallet` expresses the max quantity a _wallet_ can claim during the respective claim condition. A sophisticated actor may generate multiple wallets to claim tokens in a way that undermines such restrictions, when viewing such restrictions as restrictions on unique persons, and not wallets.

### Allowlist behavior

When specifiying allowlist of addresses, and quantities, price, etc. for those addresses, contract admins must ensure that they don't list an address more than once in the same merkle tree.
When specifying allowlist of addresses, and quantities, price, etc. for those addresses, contract admins must ensure that they don't list an address more than once in the same merkle tree.

For e.g. admin wishes to grant user X permission to mint 2 tokens at 0.25 ETH, and 4 tokens at 0.5 ETH. In this case, the contract design will not permit the user X to claim 6 tokens with different prices as desired. Instead, the user may be limited to claiming just 2 tokens or 4 tokens based on their order of claiming.

Expand Down
2 changes: 1 addition & 1 deletion contracts/prebuilts/interface/IPack.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ interface IPack is ITokenBundle {
* @param amountDistributedPerOpen The number of reward units distributed per open.
* @param recipient The recipient of the packs created.
*
* @return packId The unique identifer of the created set of packs.
* @return packId The unique identifier of the created set of packs.
* @return packTotalSupply The total number of packs created.
*/
function createPack(
Expand Down
2 changes: 1 addition & 1 deletion contracts/prebuilts/interface/IPackVRFDirect.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interface IPackVRFDirect is ITokenBundle {
* @param amountDistributedPerOpen The number of reward units distributed per open.
* @param recipient The recipient of the packs created.
*
* @return packId The unique identifer of the created set of packs.
* @return packId The unique identifier of the created set of packs.
* @return packTotalSupply The total number of packs created.
*/
function createPack(
Expand Down
2 changes: 1 addition & 1 deletion contracts/prebuilts/interface/airdrop/IAirdropERC1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interface IAirdropERC1155 {
* which acts as operator for the tokens.
*
* @param tokenAddress The contract address of the tokens to transfer.
* @param tokenOwner The owner of the the tokens to transfer.
* @param tokenOwner The owner of the tokens to transfer.
* @param contents List containing recipient, tokenId to airdrop.
*/
function airdropERC1155(
Expand Down
2 changes: 1 addition & 1 deletion contracts/prebuilts/interface/airdrop/IAirdropERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ interface IAirdropERC20 {
* which acts as operator for the tokens.
*
* @param tokenAddress The contract address of the tokens to transfer.
* @param tokenOwner The owner of the the tokens to transfer.
* @param tokenOwner The owner of the tokens to transfer.
* @param contents List containing recipient, tokenId to airdrop.
*/
function airdropERC20(
Expand Down
2 changes: 1 addition & 1 deletion contracts/prebuilts/interface/airdrop/IAirdropERC721.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ interface IAirdropERC721 {
* which acts as operator for the tokens.
*
* @param tokenAddress The contract address of the tokens to transfer.
* @param tokenOwner The owner of the the tokens to transfer.
* @param tokenOwner The owner of the tokens to transfer.
* @param contents List containing recipient, tokenId to airdrop.
*/
function airdropERC721(
Expand Down
18 changes: 9 additions & 9 deletions contracts/prebuilts/interface/marketplace/IMarketplace.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface IMarketplace is IThirdwebContract, IPlatformFee {
/**
* @notice The information related to either (1) an offer on a direct listing, or (2) a bid in an auction.
*
* @dev The type of the listing at ID `lisingId` determins how the `Offer` is interpreted.
* @dev The type of the listing at ID `lisingId` determines how the `Offer` is interpreted.
* If the listing is of type `Direct`, the `Offer` is interpreted as an offer to a direct listing.
* If the listing is of type `Auction`, the `Offer` is interpreted as a bid in an auction.
*
Expand Down Expand Up @@ -209,9 +209,9 @@ interface IMarketplace is IThirdwebContract, IPlatformFee {
* @notice Lets a listing's creator edit the listing's parameters. A direct listing can be edited whenever.
* An auction listing cannot be edited after the auction has started.
*
* @param _listingId The uid of the lisitng to edit.
* @param _listingId The uid of the listing to edit.
*
* @param _quantityToList The amount of NFTs to list for sale in the listing. For direct lisitngs, the contract
* @param _quantityToList The amount of NFTs to list for sale in the listing. For direct listings, the contract
* only checks whether the listing creator owns and has approved Marketplace to transfer
* `_quantityToList` amount of NFTs to list for sale. For auction listings, the contract
* ensures that exactly `_quantityToList` amount of NFTs to list are escrowed.
Expand Down Expand Up @@ -248,14 +248,14 @@ interface IMarketplace is IThirdwebContract, IPlatformFee {
/**
* @notice Lets a direct listing creator cancel their listing.
*
* @param _listingId The unique Id of the lisitng to cancel.
* @param _listingId The unique Id of the listing to cancel.
*/
function cancelDirectListing(uint256 _listingId) external;

/**
* @notice Lets someone buy a given quantity of tokens from a direct listing by paying the fixed price.
*
* @param _listingId The uid of the direct lisitng to buy from.
* @param _listingId The uid of the direct listing to buy from.
* @param _buyFor The receiver of the NFT being bought.
* @param _quantity The amount of NFTs to buy from the direct listing.
* @param _currency The currency to pay the price in.
Expand All @@ -265,7 +265,7 @@ interface IMarketplace is IThirdwebContract, IPlatformFee {
* (1) buyer does not own or has not approved Marketplace to transfer the appropriate
* amount of currency (or hasn't sent the appropriate amount of native tokens)
*
* (2) the lister does not own or has removed Markeplace's
* (2) the lister does not own or has removed Marketplace's
* approval to transfer the tokens listed for sale.
*/
function buy(
Expand All @@ -283,7 +283,7 @@ interface IMarketplace is IThirdwebContract, IPlatformFee {
* makes two offers to the same direct listing, the last offer is counted as the buyer's
* offer to that listing.
*
* @param _listingId The unique ID of the lisitng to make an offer/bid to.
* @param _listingId The unique ID of the listing to make an offer/bid to.
*
* @param _quantityWanted For auction listings: the 'quantity wanted' is the total amount of NFTs
* being auctioned, regardless of the value of `_quantityWanted` passed.
Expand All @@ -297,7 +297,7 @@ interface IMarketplace is IThirdwebContract, IPlatformFee {
* @param _pricePerToken For direct listings: offered price per token. For auction listings: the bid
* amount per token. The total offer/bid amount is `_quantityWanted * _pricePerToken`.
*
* @param _expirationTimestamp For aution listings: inapplicable. For direct listings: The timestamp after which
* @param _expirationTimestamp For auction listings: inapplicable. For direct listings: The timestamp after which
* the seller can no longer accept the offer.
*/
function offer(
Expand All @@ -324,7 +324,7 @@ interface IMarketplace is IThirdwebContract, IPlatformFee {

/**
* @notice Lets any account close an auction on behalf of either the (1) auction's creator, or (2) winning bidder.
* For (1): The auction creator is sent the the winning bid amount.
* For (1): The auction creator is sent the winning bid amount.
* For (2): The winning bidder is sent the auctioned NFTs.
*
* @param _listingId The uid of the listing (the auction to close).
Expand Down
4 changes: 2 additions & 2 deletions contracts/prebuilts/multiwrap/multiwrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The single wrapped token received on bundling up multiple assets, as mentioned a

A token owner should be able to wrap any combination of *n* ERC20, ERC721 or ERC1155 tokens as a wrapped NFT. When wrapping, the token owner should be able to specify a recipient for the wrapped NFT. At the time of wrapping, the token owner should be able to set the metadata of the wrapped NFT that will be minted.

The wrapped NFT owner should be able to unwrap the the NFT to retrieve the underlying tokens of the wrapped NFT. At the time of unwrapping, the wrapped NFT owner should be able to specify a recipient for the underlying tokens of the wrapped NFT.
The wrapped NFT owner should be able to unwrap the NFT to retrieve the underlying tokens of the wrapped NFT. At the time of unwrapping, the wrapped NFT owner should be able to specify a recipient for the underlying tokens of the wrapped NFT.

The `Multiwrap` contract creator should be able to apply the following role-based restrictions:

Expand Down Expand Up @@ -136,4 +136,4 @@ What does **Type (Switch / !Switch)** mean?

## Authors
- [nkrishang](https://github.com/nkrishang)
- [thirdweb team](https://github.com/thirdweb-dev)
- [thirdweb team](https://github.com/thirdweb-dev)
6 changes: 3 additions & 3 deletions contracts/prebuilts/pack/pack.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ We’ll now go over the technical details of the `Pack` contract, with reference

## What can be packed in packs?

You can create a set of packs with any combination of any number of ERC20, ERC721 and ERC1155 tokens. For example, you can create a set of packs with 10,000 [USDC](https://www.circle.com/en/usdc) (ERC20), 1 [Bored Ape Yatch Club](https://opensea.io/collection/boredapeyachtclub) NFT (ERC721), and 50 of [adidas originals’ first NFT](https://opensea.io/assets/0x28472a58a490c5e09a238847f66a68a47cc76f0f/0) (ERC1155).
You can create a set of packs with any combination of any number of ERC20, ERC721 and ERC1155 tokens. For example, you can create a set of packs with 10,000 [USDC](https://www.circle.com/en/usdc) (ERC20), 1 [Bored Ape Yacht Club](https://opensea.io/collection/boredapeyachtclub) NFT (ERC721), and 50 of [adidas originals’ first NFT](https://opensea.io/assets/0x28472a58a490c5e09a238847f66a68a47cc76f0f/0) (ERC1155).

With strictly non-fungible tokens i.e. ERC721 NFTs, each NFT has a supply of 1. This means if a pack is opened and an ERC721 NFT is selected by the `Pack` contract to be distributed to the opener, that 1 NFT will be distributed to the opener.

Expand All @@ -79,7 +79,7 @@ uint256 perUnitAmount;
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| assetContract | The contract address of the token. |
| tokenType | The type of the token -- ERC20 / ERC721 / ERC1155 |
| tokenId | The tokenId of the the token. (Not applicable for ERC20 tokens. The contract will ignore this value for ERC20 tokens.) |
| tokenId | The tokenId of the token. (Not applicable for ERC20 tokens. The contract will ignore this value for ERC20 tokens.) |
| totalAmount | The total amount of this token packed in the pack. (Not applicable for ERC721 tokens. The contract will always consider this as 1 for ERC721 tokens.) |
| perUnitAmount | The amount of this token to distribute as a unit, on opening a pack. (Not applicable for ERC721 tokens. The contract will always consider this as 1 for ERC721 tokens.) |

Expand Down Expand Up @@ -120,7 +120,7 @@ Since packs are ERC1155 tokens, you can publish multiple sets of packs using the

### Supply of packs

When creating packs, you can specify the numer of reward units to distribute to the opener on opening a pack. And so, when creating a set of packs, the total number of packs in that set is calculated as:
When creating packs, you can specify the number of reward units to distribute to the opener on opening a pack. And so, when creating a set of packs, the total number of packs in that set is calculated as:

`total_supply_of_packs = (total_reward_units) / (reward_units_to_distribute_per_open)`

Expand Down
2 changes: 1 addition & 1 deletion contracts/prebuilts/unaudited/airdrop/AirdropERC1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ contract AirdropERC1155 is
* which acts as operator for the tokens.
*
* @param _tokenAddress The contract address of the tokens to transfer.
* @param _tokenOwner The owner of the the tokens to transfer.
* @param _tokenOwner The owner of the tokens to transfer.
* @param _contents List containing recipient, tokenId and amounts to airdrop.
*/
function airdropERC1155(
Expand Down
2 changes: 1 addition & 1 deletion contracts/prebuilts/unaudited/airdrop/AirdropERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ contract AirdropERC20 is
* which acts as operator for the tokens.
*
* @param _tokenAddress The contract address of the tokens to transfer.
* @param _tokenOwner The owner of the the tokens to transfer.
* @param _tokenOwner The owner of the tokens to transfer.
* @param _contents List containing recipient, tokenId and amounts to airdrop.
*/
function airdropERC20(
Expand Down
2 changes: 1 addition & 1 deletion contracts/prebuilts/unaudited/airdrop/AirdropERC721.sol
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ contract AirdropERC721 is
* which acts as operator for the tokens.
*
* @param _tokenAddress The contract address of the tokens to transfer.
* @param _tokenOwner The owner of the the tokens to transfer.
* @param _tokenOwner The owner of the tokens to transfer.
* @param _contents List containing recipient, tokenId to airdrop.
*/
function airdropERC721(
Expand Down

0 comments on commit a001aa5

Please sign in to comment.