Skip to content

guibescos/pyth-aptos-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

100$ USD Mint

The goal of this contract is managing an NFT mint where the mint is paid in native currency but the cost of one NFT is always 100$. This example is intended to be run on Aptos testnet because it depends on Pyth and Wormhole existing onchain.

How to deploy the smart contract :

  • Use aptos init with rest_url : https://testnet.aptoslabs.com/ and faucet https://faucet.testnet.aptoslabs.com to generate a new keypair.
  • Use a faucet to airdrop testnet APT to your newly created account by calling aptos account fund-with-faucet --account default. If this doesn't work, I have had success importing my private key from .aptos/config.yaml into Petra and clicking the airdrop button. Otherwise send APT from another account.
  • Get your account address from .aptos/config.yaml and replace mint_nft="_" by mint_nft="<ADDRESS>" in Move.toml
  • aptos move compile
  • aptos move publish

How to run the webapp :

  • In app/src/App.tsx replace const MINT_NFT_MODULE = "_" by const MINT_NFT_MODULE = "<ADDRESS>" the address of your module from above.
  • npm install
  • npm run start
  • Go to http://localhost:3000/ in your browser and use Petra wallet to transact with the app.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published