Giter Site home page Giter Site logo

futurex-poaps's Introduction

FutureX POAPs

Core functions

API not stable yet.

Creat Read Update Delete:

  • C: Add Event - creatEvent

  • C: Add Event Organizer - addEventMinter

  • C: Add admin - addAdmin

  • C: Mint token for an event - mintToken

  • C: Batch Mint - mintEventToManyUsers

  • R: view all poaps for one user - (balanceOf, then eventOfOwnerByIndex)

  • R: view all users for one event - (balanceOfEvent, then userOfEventByIndex)

  • R: view user role - isEventMinter, isEventCreator, isAdmin

  • R: view event infos - eventHasUser, eventMetaURI

  • U: Pause or un-pause contract - pause, unpause

  • U: Authorize or un-authorize contract - authorize, unauthorize

  • D: Burn Tokens - burn

  • : ERC721 interfaces - (base, URI, enumerable)

Checkout test/Poap.js for more details.

Deploy to local

  1. Install deps with npm install

  2. Enable your local blockchain with command npx hardhat node first, and let this session stay opened.

  3. Run command npx hardhat deploy-poap --network localhost to deploy the Poaps. It shall output the proxy contract address [ADDRESS].

  4. Interact with the contract using npx hardhat console --network localhost

    > const Poap = await ethers.getContractFactory("Poap")
    > const poap = await Poap.attach("[ADDRESS]")
    > await poap.name()
    ...
  5. Stay the above console opened, you can update the contract functions under contracts/* and use npx hardhat upgrade-poap --network localhost [ADDRESS] to upgrade. You can then continue testing the functions with poap object in step.3

Deploy to BlockChains

Future-Poap supports Goerli testnet and Gnosis sidechain for now, check out more details in hardhat.config.js. To enable deployment, create a .env file under root dir:

For Gnosis, you should set up your private key and api token from gnosisscan:

Gnosis_PRIVATE_KEY = "XXX"
Gnosis_API = "XXX"

For Goerli testnet, you should set up your private key and a provider's url(e.g. Alchemy):

Goerli_API_URL = "https://eth-goerli.g.alchemy.com/v2/XXX"
Goerli_PRIVATE_KEY = "XXX"

Then you can deploy and interact the contract following the commands in "Deploy to local" section, but only replace all the localhost term to your network(gnosis for Gnosis, goerli for Goerli testnet).

To add more chains, please refer to their documents about hardhat development.

Commands

npx hardhat compile # compile contracts to artifacts
npx hardhat test # test the contracts using test/*.js 
REPORT_GAS=true npx hardhat test # estimate the contracts gas fee. Extremly SLOW

npx hardhat run scripts/deploy.js --network XXX

Acknowledgement

Thanks to the great open-sourced POAPs contract from poap.xyz !

futurex-poaps's People

Contributors

gusye1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

dr-data

futurex-poaps's Issues

Remove Poaps transfer functions

Current Poaps is OKay with transferring, but maybe we shall disable this support and make it "soul-bounded".

function approve(address to, uint256 tokenId)
public
override
whenNotPaused
{
super.approve(to, tokenId);
}
function setApprovalForAll(address to, bool approved)
public
override
whenNotPaused
{
super.setApprovalForAll(to, approved);
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public override whenNotPaused {
super.transferFrom(from, to, tokenId);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.