Polygon Asset Tokenisation Example powered by SettleMint
- Create an account on SettleMint here
- Create an Organisation (e.g. Your_Name_Organisation)
- Create an Application (e.g. Your_Name_Application)
- Click on Blockchain networks and add a
Polygon Testnet
network and a node (e.g. Your_Name_Network, Your_Name_Node). Note: choose the smallest resources - Click on Storage and add a
IPFS (decentralised)
storage. Note: choose the smallest resources - Click on Private keys and add a
Accessible EC DSA P256
key - Click on Smart Contracts sets and add a
Empty
template (e.g. Your_Name_Asset_Tokenisation). Note: choose the smallest resources
- In the SettleMint BPass Platform, head over to
Private keys
and copyprivate key
- Head over to
https://faucet.polygon.technology/
- Under
Mumbai
Network, paste yourprivate key
and clickSubmit
- Note down your private key (notes/stickies/etc)
- Head over to
https://polygonscan.com/
and go toAPI-KEYs
- Create your API key and copy it
- Note down your API key (notes/stickies/etc)
- In the SettleMint BPass Platform, head over to
Smart contract sets
- Click on your deployed smart contract set and go to the IDE tab and click
view in fullscreen mode
- Copy the template
AssetTokenisation.sol
found in./Smart-Contracts
and paste it in the IDE's folder./contracts
. Make sure your file name is the same as the contract name, e.g.AssetTokenisation.sol
==contract AssetTokenisation ...
- In the folder
./deploy
, open the file named00_deploy_example.ts
and in line 13, change the name of the contract depending on your file name
await deploy('AssetTokenisation', {
from: deployer,
args: [],
log: true,
});
- In the root folder, open the file named
hardhat.config.ts
and in line 34, change the Solidity version to 0.8.13 and add in your noted down PolygonScan API key
const config: HardhatUserConfig = {
abiExporter,
solidity: {
version: '0.8.13',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
evmVersion: 'istanbul',
},
},
etherscan: {
apiKey: {
polygon : 'xxx'
}
},
namedAccounts,
networks,
};
- Deploy your Asset Tokenisation smart contract!
pnpm run smartcontract:deploy:reset
-
Note down your deployed smart contract address (notes/stickies/etc)
-
Open the
abi
folder, go toAssetTokenisation.json
and copy the json contents -
Note down your json contents (notes/stickies/etc)
- In the SettleMint BPass Platform, click on your profile icon at the top right at click on
API keys
- Check all the boxes and generate your API key
- Note down your API key (notes/stickies/etc)
- In the SettleMint BPass Platform, head over to
Storage
and click into your deployedIPFS (decentralised)
storage - Click on the
File Manager
tab and click on theImport
button and chooseFile
- Choose an image that represents your asset and upload your image
- Click on the ellipsis at the far right and click
Set pinning
to pin your image - Click on the ellipsis at the far right again and click
Share link
to copy the link to your image - Note down your image uri
- In the SettleMint BPass Platform, click on
Blockchain nodes
, click on your deployed node and click onConnect
- Note down your
JSON-RPC
endpoint
- Now, you are ready to BUIDL!
- In the SettleMint BPass Platform, click on
Integration tools
and deploy anIntegration Studio
tool - Click on your deployed
Integration Studio
, click onInterface
and clickview in fullscreen mode
- At the top right dropdown box, click on
Import
and import theflows.json
found in theIntegration-Studio
directory here in anew flow
- Once imported, click on the
Asset Tokenisation
tab and clickDeploy
at the top right
- Double click on the
Set Global Variables
module - Go to the
On Message
tab and input your noted down variables and clickDone
'privateKey': '0x...',
'contract': '0x...',
'bpassKey': 'bpaas-...',
'rpcEndpoint': 'https://...',
'abi': []
- Click on
Deploy
at the top right and click on the blue button next to theinject
module, next toSet Global Variables
module. - You can view the output at the debug window on the right side by clicking on the bug icon.
- Double click on the
inject
module next to theInitialise Asset
module - Input your variables and click
Done
msg.assetName = ''
msg.assetSymbol = ''
msg.assetUri = ''
- Click on
Deploy
at the top right and click on the blue button next to theinject
module, next toInitialise Asset
module. - You can view the output at the debug window on the right side by clicking on the bug icon.
- Click on the blue button next to the
inject
module, next to theCurrent Time + 10 Minutes
module - You can view the output at the debug window on the right side by clicking on the bug icon. Take note of the
end
value. This will be used as the maturity time input for the next step.
- Double click on the inject module next to the
Create Asset
module - Input your variables and click
Done
msg.assetId = e.g. 1
msg.maxSupply = e.g. 100
msg.faceValue = e.g. 1000
msg.maturityTime = <end value>
- Click on the blue button next to the
inject
module, next to theView Asset
module - You can view the output at the debug window on the right side by clicking on the bug icon.
- Double click on the inject module next to the
Mint Asset
module - Input your variables and click
Done
msg.assetId = e.g. 1
msg.amounts = e.g. 10
msg.recipient = e.g. recipient address
- Click on
Deploy
at the top right and click on the blue button next to theinject
module, next toMint Asset
module. - You can view the output at the debug window on the right side by clicking on the bug icon.
- Click on the blue button next to the
inject
module, next to theView Balance
module - You can view the output at the debug window on the right side by clicking on the bug icon.
Congratuations! You have minted your first asset on an Asset Tokenisaton Contract through SettleMint!
CTA