A set of contracts to hold NFTs, capture royalties, and subscribe to services.
See Freeport.sol.
See the documentation (regenerate with npm run doc
).
- 8_upgrade_freeport
- 9_upgrade_simple_auction
- 11_upgrade_fiat_gateway
- 23_upgrade_auction
- 24_upgrade_collection_factory
- 25_upgrade_marketplace
- 26_upgrade_nftattachment
- Re-run 26_upgrade_nftattachment
- Re-run 24_upgrade_collection_factory
- Re-run 25_upgrade_marketplace
- Transfer on factory
- FREEP-693: added forwarder role to Biconomy forwarder
- fix-configure_deployment: support fresh artifact files
Contracts: Freeport and Fiat Gateway and Simple Auction and NFT Attachment and USDC ERC20 and CollectionFactory and Auction and Marketplace .
Accounts: Fiat-to-NFT Service ( see prod_setup). Biconomy enabled. Admin Gnosis Safe.
Contracts: Freeport and Fiat Gateway and Simple Auction and NFT Attachment and Test USDC and CollectionFactory and Auction and Marketplace .
Accounts: Fiat-to-NFT Service ( see stage_setup). Biconomy enabled. Admin.
Contracts: Freeport and Fiat Gateway and Simple Auction and NFT Attachment and Test USDC and CollectionFactory and Auction and Marketplace .
Accounts: Fiat-to-NFT Service ( see dev_setup). Biconomy enabled. Admin.
Contracts: Freeport and Fiat Gateway and Simple Auction and NFT Attachment and TestERC20.
Accounts: Fiat-to-NFT Service ( see dev_setup). Biconomy enabled. Admin.
Review all code changes since the last deployed release. Understand how upgradeable contracts work (see doc). Pay attention to:
- Events: make sure the event listeners are upgraded to support both new and old versions of events at the same time.
- Structure changes: make sure existing fields do not change in any way, only new fields are added.
- Existing data: the existing objects in the contract will have a zero value for new fields; make sure the code handles this correctly.
- Functions: make sure that no public function was removed or signature changed.
- Initialization: if a new feature requires some initialization, make sure this happens in a new
initialize_vX.X.X
function, and that this function is called during the upgrade (example: initialize_v2_0_0). - Unit tests: understand what behavior changed.
Bump the version, maintain CHANGELOG.md, and create a release in github.
Then, select which deployment to operate on. One way is to use the configure_deployment script (see configuration inside).
Choose a migration script depending on which contract to upgrade (e.g.: N=8). For the DEV environment, you need to edit the addresses in build/*.json
. Then run:
npm run test
export MNEMONIC=" …mnemonic of a wallet that is admin… "
truffle migrate --compile-all --network=polygon_testnet -f N --to N
Release the JS SDK (see instructions).
npm test
npm run migrate --network=polygon_testnet
Write down the contract address and current version in the Releases section above.
Commit these files in build/contracts/
: Freeport.json
, FiatGateway.json
, SimpleAuction.json
, NFTAttachment.json
.
For dev on Polygon testnet, setup test accounts:
truffle exec scripts/dev_setup.js --network=polygon_testnet
For staging on Polygon testnet, setup test accounts:
truffle exec scripts/stage_setup.js --network=polygon_testnet
For prod on Polygon mainnet, setup production accounts (edit the scripts to change accounts):
truffle exec scripts/prod_setup.js --network=polygon_mainnet
truffle exec scripts/prod_add_admin.js --network polygon_mainnet
The script will print the address of the different accounts, including the fiat-to-nft service account.
Verify on Polyscan using the information in Freeport.json and the flattened code:
npm run flatten
More instructions can be found in the original README of the template.
sudo . ./copy-artifacts.sh dir_path_to (copy to your directory)
sudo . ./copy-artifacts.sh (copy to default ./artifacts directory)
export MNEMONIC='spatial spin account funny glue cancel cushion twelve inmate author night dust'
export NETWORK_ID=5777
docker run -d -p 8545:8545 524725240689.dkr.ecr.us-west-2.amazonaws.com/crb-davinci-nft-test:latest --db /app/db --mnemonic $MNEMONIC --networkId $NETWORK_ID
- Open SDK project in IDE, switch to master branch
- Copy smart-contract artifacts from
/build/contracts
to SDK's/src/artifacts
- Run
yarn update-types
- Commit changes with message like "artifacts from commit e57691bc"
- Check that
npm whoami
returns "cere-io" (otherwise update your NPM_TOKEN env var for publishing @cere packages) - Run
yarn deploy
and publish next version ( see Versioning) - Push changes to the remote branch
- Install the new version of SDK in projects that use it
Readme.md for running e2e-test locally
is here. For this
service you need to create image locally and tag it with
tag 524725240689.dkr.ecr.us-west-2.amazonaws.com/crb-davinci-nft-test:YOUR_CUSTOM_TAG
and use YOUR_CUSTOM_TAG
for running e2e-tests locally.
After merge in develop, make sure that tests passed in @e2e-test-results channel on Cere Slack.