Search…
Super 721 ABI and Methods
This document will detail the interface of the smart contracts you deploy on Cargo. This will allow you to write smart contracts which interact with the NFT smart contracts you deploy on Cargo.

Contract ABI

You can retrieve the contract ABI at the following location https://development.cargo.engineering/v5/contract-abi/eth/super721V2. See the abi property in the response.

Methods

The Cargo Super 721 smart contract uses the ERC-721 and ERC-2309 standards. The contract adheres to the core 721 standard and the metadata extension. The Cargo Super 721 smart contract does not implement the optional enumeration extension - enumeration can be determined using logs.

transferMultiple(from, to, fromAddress, toAddresses)

This is a convenience method that can be used to transfer consecutive batches of arbitrary NFTs by ID. This method uses arrays and loops, so keep in mind that the more NFTs you transfer the higher the transaction fee will be. There will be an upper limit on the amount of NFTs you can transfer in one transaction.
Arguments
  • from - uint256[] An array which contains the starting token IDs in a consecutive range. This must correspond to the integer at the same index in the to array.
  • to - uint256[] An array which contains the ending token IDs in a consecutive range. This must correspond to the integer at the same index in the from array.
  • fromAddress - address The wallet address which currently owns the NFTs to be transferred.
  • toAddresses - address[] An array of addresses which correspond to the indices of the from and to arrays.
Examples
Transferring single NFTs to a new address
1
contract.transferMultiple(
2
// This states transfer token IDs 1 to 1 and 5 to 5
3
// This is transferring only tokens with ID 1 and 5, so two NFTs
4
// This is how you can transfer a batch of consecutive tokens
5
// with length of 1
6
['1', '5'],
7
['1', '5'],
8
fromAddress,
9
[toAddress1, toAddress2]
10
)
Copied!
Transferring multiple ranges of NFTs to a new address
1
contract.transferMultiple(
2
// This transfers NFTs 1 - 3 and 5 - 15
3
['1', '5'],
4
['3', '15'],
5
fromAddress,
6
[toAddress1, toAddress2
7
)
Copied!

batchTransfer(fromTokenId, toTokenId, fromAddress, toAddress)

You can use this method to transfer a consecutive range of NFTs. The transferMultiple method uses this method under the hood, so the same limitations apply.
Arguments
  • from - uint256 The starting token ID in a consecutive range.
  • to - uint256 The ending token ID in a consecutive range.
  • fromAddress - address The address which currently owns the NFTs to be transferred
  • toAddress - address The address to receive the NFTs

updateCreator(iKnowWhatIAmDoing, newCreator)

You can use this method to update the contract owner. By default the creator will be set as the original wallet address which deploys the contract. Only the current creator can call this method.
Arguments
  • iKnowWhatIAmDoing - bool A precautionary boolean. Set to true to confirm that you know what you are doing.
  • newCreator - address The wallet address of the new creator.

batchMint(amount, toAddress, sessionId, signature)

This method is used to create new NFTs. This requires a session ID and signature which is provided by Cargo. You can see how you can obtain this information by reviewing the Creating NFTs section in the Cargo JS docs.
If you'd like a method to obtain a session ID and signature to bypass minting using Cargo's built in system please let us know by emailing [email protected]
Arguments
  • amount - uint256 The number of new NFTs to mint
  • toAddress - address The address that will own the new NFTs
  • sessionID
  • signature

burn(tokenId)

This method can be used to "burn" an NFT.
Arguments
  • tokenId - uint256 The token ID of the NFT to burn

version()

This method can be called to determine the version of the smart contract.

tokenURI(tokenId)

You can use this method to get the token URI of the specified token ID. The base URI will have the contract address and token ID appended example: baseUrl + contractAddress + '/' + tokenId
Depending on the version of your contract the appended path parameters may include an additional /v3 which is added after the token ID.
Version 3 will have the additional parameter. The version can be checked by calling the version method.
Arguments
  • tokenId - uint256 The token ID

updateUriBase(base)

The creator of the contract can use this method to update the base URI for the return value of the tokenURI method. See the tokenURI method above to see what is appended to the base URI.

unsetBase()

The creator of the contract can use this method to remove the set base URI thus reverting to the default base URI.
Last modified 28d ago