Request form
POAP
  • Soulbound
  • Token
  • Protocol
Docs
Source
ChefGPT

POAP are the bookmarks for your life. Mint the most important memories of your life as digital collectibles (NFTs) forever on the blockchain.

PoapPausable :
Base contract which allows children to implement an emergency stop mechanism.
pause() :
called by the owner to pause, triggers stopped state
unpause() :
called by the owner to unpause, returns to normal state
Roles :
Library for managing addresses assigned to a Role.
Counters :
Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number of elements in a mapping, issuing ERC721 ids, or counting request ids * Include with `using Counters for Counters.Counter;` Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the SafeMath overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never directly accessed.
ERC165 :
Implements ERC165 using a lookup table.
initialize() :
A contract implementing SupportsInterfaceWithLookup implement ERC165 itself
supportsInterface(bytes4) :
implement supportsInterface(bytes4) using a lookup table
IERC165 :
https://eips.ethereum.org/EIPS/eip-165
supportsInterface(bytes4) :
Interface identification is specified in ERC-165. This function uses less than 30,000 gas.
SafeMath :
Unsigned math operations with safety checks that revert on error
ERC721 :
see https://eips.ethereum.org/EIPS/eip-721
approve(address,uint256) :
Approves another address to transfer the given token ID The zero address indicates there is no approved address. There can only be one approved address per token at a given time. Can only be called by the token owner or an approved operator.
balanceOf(address) :
Gets the balance of the specified address
getApproved(uint256) :
Gets the approved address for a token ID, or zero if no address set Reverts if the token ID does not exist.
isApprovedForAll(address,address) :
Tells whether an operator is approved by a given owner
ownerOf(uint256) :
Gets the owner of the specified token ID
safeTransferFrom(address,address,uint256) :
Safely transfers the ownership of a given token ID to another address If the target address is a contract, it must implement `onERC721Received`, which is called upon a safe transfer, and return the magic value `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, the transfer is reverted. Requires the msg.sender to be the owner, approved, or operator
safeTransferFrom(address,address,uint256,bytes) :
Safely transfers the ownership of a given token ID to another address If the target address is a contract, it must implement `onERC721Received`, which is called upon a safe transfer, and return the magic value `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, the transfer is reverted. Requires the msg.sender to be the owner, approved, or operator
setApprovalForAll(address,bool) :
Sets or unsets the approval of a given operator An operator is allowed to transfer all tokens of the sender on their behalf
supportsInterface(bytes4) :
implement supportsInterface(bytes4) using a lookup table
transferFrom(address,address,uint256) :
Transfers the ownership of a given token ID to another address Usage of this method is discouraged, use `safeTransferFrom` whenever possible Requires the msg.sender to be the owner, approved, or operator
ERC721Enumerable :
See https://eips.ethereum.org/EIPS/eip-721
approve(address,uint256) :
Approves another address to transfer the given token ID The zero address indicates there is no approved address. There can only be one approved address per token at a given time. Can only be called by the token owner or an approved operator.
balanceOf(address) :
Gets the balance of the specified address
getApproved(uint256) :
Gets the approved address for a token ID, or zero if no address set Reverts if the token ID does not exist.
initialize() :
Constructor function
isApprovedForAll(address,address) :
Tells whether an operator is approved by a given owner
ownerOf(uint256) :
Gets the owner of the specified token ID
safeTransferFrom(address,address,uint256) :
Safely transfers the ownership of a given token ID to another address If the target address is a contract, it must implement `onERC721Received`, which is called upon a safe transfer, and return the magic value `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, the transfer is reverted. Requires the msg.sender to be the owner, approved, or operator
safeTransferFrom(address,address,uint256,bytes) :
Safely transfers the ownership of a given token ID to another address If the target address is a contract, it must implement `onERC721Received`, which is called upon a safe transfer, and return the magic value `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, the transfer is reverted. Requires the msg.sender to be the owner, approved, or operator
setApprovalForAll(address,bool) :
Sets or unsets the approval of a given operator An operator is allowed to transfer all tokens of the sender on their behalf
supportsInterface(bytes4) :
implement supportsInterface(bytes4) using a lookup table
tokenByIndex(uint256) :
Gets the token ID at a given index of all the tokens in this contract Reverts if the index is greater or equal to the total number of tokens
tokenOfOwnerByIndex(address,uint256) :
Gets the token ID at a given index of the tokens list of the requested owner
totalSupply() :
Gets the total amount of tokens stored by the contract
transferFrom(address,address,uint256) :
Transfers the ownership of a given token ID to another address Usage of this method is discouraged, use `safeTransferFrom` whenever possible Requires the msg.sender to be the owner, approved, or operator
IERC721 :
see https://eips.ethereum.org/EIPS/eip-721
supportsInterface(bytes4) :
Interface identification is specified in ERC-165. This function uses less than 30,000 gas.
IERC721Enumerable :
See https://eips.ethereum.org/EIPS/eip-721
supportsInterface(bytes4) :
Interface identification is specified in ERC-165. This function uses less than 30,000 gas.
IERC721Metadata :
See https://eips.ethereum.org/EIPS/eip-721
supportsInterface(bytes4) :
Interface identification is specified in ERC-165. This function uses less than 30,000 gas.
IERC721Receiver :
Interface for any contract that wants to support safeTransfers from ERC721 asset contracts.
onERC721Received(address,address,uint256,bytes) :
The ERC721 smart contract calls this function on the recipient after a `safeTransfer`. This function MUST return the function selector, otherwise the caller will revert the transaction. The selector to be returned can be obtained as `this.onERC721Received.selector`. This function MAY throw to revert and reject the transfer. Note: the ERC721 contract address is always the message sender.
Initializable :
Helper contract to support initializer functions. To use it, replace the constructor with a function that has the `initializer` modifier. WARNING: Unlike constructors, initializer functions must be manually invoked. This applies both to deploying an Initializable contract, as well as extending an Initializable contract via inheritance. WARNING: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or ensure that all initializers are idempotent, because this is not dealt with automatically as with constructors.
Poap.sol
PoapPausable.sol
PoapRoles.sol
XPoap.sol
Roles.sol
Counters.sol
ERC165.sol
IERC165.sol
SafeMath.sol
ERC721.sol
ERC721Enumerable.sol
IERC721.sol
IERC721Enumerable.sol
IERC721Metadata.sol
IERC721Receiver.sol
Address.sol
Initializable.sol

111 downloads

Chains

Authors

POAP
  • Soulbound
  • Token
  • Protocol
Info
Docs
Source
ChefGPT
Expand
Share

Get Cookin'

111 downloads

Authors

Setup

Install dependencies:

nvm use # Should install node 10.16.0
npm install -g ganache-cli
npm install

Ganache

Run Ganache:

ganache-cli --port 9545 --deterministic

Any time you shutdown ganache, you will need to do zos push and zos create to deploy the project into the blank blockchain.

npx zos session --network local --from 0x1df62f291b2e969fb0849d99d9ce41e2f137006e --expires 3600
zos push
zos create XPoap --init initialize --args '"Poap","POAP","https://poap.xyz",[]'

Truffle Commands

To run a console:

npx truffle console --network local

To run tests:

npx truffle test

Useful Commands

Working with ZeppelinOS

Session

Start by creating a session:

npx zos session --network local --from 0x1df62f291b2e969fb0849d99d9ce41e2f137006e --expires 3600

This creates a "connection" that will be used for every zos command. We define which network to connect, which account to use by default for all transaction and when it expires (3600 seconds after last used).

If no current session exists, or it its expired we need to create one.

Create or Upgrade Contracts

When we create a new contract run:

npx zos add MyContract

To upgrade a current contract (change the code of it)

npx zos update MyContract

After any change we need to push the changes:

npx zos push

add and update only change the contract instance, but they don't actually release/create an instance of that contract. To create an instance we do:

npz zos create MyContract --init initialize --args 42,hitchhiker

Contract addresses

Production

Development

POAP are the bookmarks for your life. Mint the most important memories of your life as digital collectibles (NFTs) forever on the blockchain.
PoapPausable :
Base contract which allows children to implement an emergency stop mechanism.
pause() :
called by the owner to pause, triggers stopped state
unpause() :
called by the owner to unpause, returns to normal state
Roles :
Library for managing addresses assigned to a Role.
Counters :
Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number of elements in a mapping, issuing ERC721 ids, or counting request ids * Include with `using Counters for Counters.Counter;` Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the SafeMath overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never directly accessed.
ERC165 :
Implements ERC165 using a lookup table.
initialize() :
A contract implementing SupportsInterfaceWithLookup implement ERC165 itself
supportsInterface(bytes4) :
implement supportsInterface(bytes4) using a lookup table
IERC165 :
https://eips.ethereum.org/EIPS/eip-165
supportsInterface(bytes4) :
Interface identification is specified in ERC-165. This function uses less than 30,000 gas.
SafeMath :
Unsigned math operations with safety checks that revert on error
ERC721 :
see https://eips.ethereum.org/EIPS/eip-721
approve(address,uint256) :
Approves another address to transfer the given token ID The zero address indicates there is no approved address. There can only be one approved address per token at a given time. Can only be called by the token owner or an approved operator.
balanceOf(address) :
Gets the balance of the specified address
getApproved(uint256) :
Gets the approved address for a token ID, or zero if no address set Reverts if the token ID does not exist.
isApprovedForAll(address,address) :
Tells whether an operator is approved by a given owner
ownerOf(uint256) :
Gets the owner of the specified token ID
safeTransferFrom(address,address,uint256) :
Safely transfers the ownership of a given token ID to another address If the target address is a contract, it must implement `onERC721Received`, which is called upon a safe transfer, and return the magic value `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, the transfer is reverted. Requires the msg.sender to be the owner, approved, or operator
safeTransferFrom(address,address,uint256,bytes) :
Safely transfers the ownership of a given token ID to another address If the target address is a contract, it must implement `onERC721Received`, which is called upon a safe transfer, and return the magic value `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, the transfer is reverted. Requires the msg.sender to be the owner, approved, or operator
setApprovalForAll(address,bool) :
Sets or unsets the approval of a given operator An operator is allowed to transfer all tokens of the sender on their behalf
supportsInterface(bytes4) :
implement supportsInterface(bytes4) using a lookup table
transferFrom(address,address,uint256) :
Transfers the ownership of a given token ID to another address Usage of this method is discouraged, use `safeTransferFrom` whenever possible Requires the msg.sender to be the owner, approved, or operator
ERC721Enumerable :
See https://eips.ethereum.org/EIPS/eip-721
approve(address,uint256) :
Approves another address to transfer the given token ID The zero address indicates there is no approved address. There can only be one approved address per token at a given time. Can only be called by the token owner or an approved operator.
balanceOf(address) :
Gets the balance of the specified address
getApproved(uint256) :
Gets the approved address for a token ID, or zero if no address set Reverts if the token ID does not exist.
initialize() :
Constructor function
isApprovedForAll(address,address) :
Tells whether an operator is approved by a given owner
ownerOf(uint256) :
Gets the owner of the specified token ID
safeTransferFrom(address,address,uint256) :
Safely transfers the ownership of a given token ID to another address If the target address is a contract, it must implement `onERC721Received`, which is called upon a safe transfer, and return the magic value `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, the transfer is reverted. Requires the msg.sender to be the owner, approved, or operator
safeTransferFrom(address,address,uint256,bytes) :
Safely transfers the ownership of a given token ID to another address If the target address is a contract, it must implement `onERC721Received`, which is called upon a safe transfer, and return the magic value `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, the transfer is reverted. Requires the msg.sender to be the owner, approved, or operator
setApprovalForAll(address,bool) :
Sets or unsets the approval of a given operator An operator is allowed to transfer all tokens of the sender on their behalf
supportsInterface(bytes4) :
implement supportsInterface(bytes4) using a lookup table
tokenByIndex(uint256) :
Gets the token ID at a given index of all the tokens in this contract Reverts if the index is greater or equal to the total number of tokens
tokenOfOwnerByIndex(address,uint256) :
Gets the token ID at a given index of the tokens list of the requested owner
totalSupply() :
Gets the total amount of tokens stored by the contract
transferFrom(address,address,uint256) :
Transfers the ownership of a given token ID to another address Usage of this method is discouraged, use `safeTransferFrom` whenever possible Requires the msg.sender to be the owner, approved, or operator
IERC721 :
see https://eips.ethereum.org/EIPS/eip-721
supportsInterface(bytes4) :
Interface identification is specified in ERC-165. This function uses less than 30,000 gas.
IERC721Enumerable :
See https://eips.ethereum.org/EIPS/eip-721
supportsInterface(bytes4) :
Interface identification is specified in ERC-165. This function uses less than 30,000 gas.
IERC721Metadata :
See https://eips.ethereum.org/EIPS/eip-721
supportsInterface(bytes4) :
Interface identification is specified in ERC-165. This function uses less than 30,000 gas.
IERC721Receiver :
Interface for any contract that wants to support safeTransfers from ERC721 asset contracts.
onERC721Received(address,address,uint256,bytes) :
The ERC721 smart contract calls this function on the recipient after a `safeTransfer`. This function MUST return the function selector, otherwise the caller will revert the transaction. The selector to be returned can be obtained as `this.onERC721Received.selector`. This function MAY throw to revert and reject the transfer. Note: the ERC721 contract address is always the message sender.
Initializable :
Helper contract to support initializer functions. To use it, replace the constructor with a function that has the `initializer` modifier. WARNING: Unlike constructors, initializer functions must be manually invoked. This applies both to deploying an Initializable contract, as well as extending an Initializable contract via inheritance. WARNING: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or ensure that all initializers are idempotent, because this is not dealt with automatically as with constructors.
Poap.sol
PoapPausable.sol
PoapRoles.sol
XPoap.sol
Roles.sol
Counters.sol
ERC165.sol
IERC165.sol
SafeMath.sol
ERC721.sol
ERC721Enumerable.sol
IERC721.sol
IERC721Enumerable.sol
IERC721Metadata.sol
IERC721Receiver.sol
Address.sol
Initializable.sol