Smart contract for shurg NFT
Each shrug image is represented by Shrug NFT which includes ownership, detailed information. The information of token is saved on IPFS as json format and it includes the IPFS uri of shrug image.
Users can buy Shrug NFT with ETH, STMX, USDT and the price of each token is calculated by contract which is based on exponential bonding curve logic. The max supply of Shrug NFT is 500 as constant. Shrug NFT project interacts with ChainLink price feed aggregators to retrieve latest price of assets to increase security and decrease vulnerability points like flash loan attack.
ShrugNFT
: 0x90cF3d432F84f6696107E378d5D848C9A738db07
ShrugSale
: 0xA96F2d842A40EA29411CE34B1544a2253f0c8011
ShrugNFT
: 0x3294389d8748A661Bf7A1e86dfC6d2B004B76d5A
ShrugSale
: 0x30b4Da4fE936694C6eddd00EE4fcDD83606262ee
- First clone this repository to your computer.
$ git clone ...
$ cd nft-shrug
- Then install the node modules.
$ npm install
- Create secret.mainnet.json & secret.testnet.json in root directory. Fill out all info needed on those files in according to secret.example.json.
{
"mnemonic": "",
"infura_api_key": "",
"recipient1_address": "",
"recipient2_address": "",
"usdt_token_address": "",
"stmx_token_address": "",
"eth_usd_aggregator_address": "",
"stmx_usd_aggregator_address": "",
"usdt_usd_aggregator_address": ""
}
- Run development server using Truffle.
$ truffle develop
- Deploy contracts.
$ truffle migrate
$ truffle migrate --network testnet
$ truffle migrate --network mainnet
-
Truffle Commands: https://www.trufflesuite.com/docs/truffle/reference/truffle-commands
-
IPFS https://ipfs.io/
-
ChainLink Ethereum Price Feeds. https://docs.chain.link/docs/ethereum-addresses/
-
Flash loan attack https://coinmarketcap.com/alexandria/article/what-are-flash-loan-attacks