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 Testnetnetwork 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 P256key - Click on Smart Contracts sets and add a
Emptytemplate (e.g. Your_Name_Asset_Tokenisation). Note: choose the smallest resources
- In the SettleMint BPass Platform, head over to
Private keysand copyprivate key - Head over to
https://faucet.polygon.technology/ - Under
MumbaiNetwork, paste yourprivate keyand 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.solfound in./Smart-Contractsand 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.tsand 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.tsand 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
abifolder, go toAssetTokenisation.jsonand 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
Storageand click into your deployedIPFS (decentralised)storage - Click on the
File Managertab and click on theImportbutton and chooseFile - Choose an image that represents your asset and upload your image
- Click on the ellipsis at the far right and click
Set pinningto pin your image - Click on the ellipsis at the far right again and click
Share linkto 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-RPCendpoint
- Now, you are ready to BUIDL!
- In the SettleMint BPass Platform, click on
Integration toolsand deploy anIntegration Studiotool - Click on your deployed
Integration Studio, click onInterfaceand clickview in fullscreen mode - At the top right dropdown box, click on
Importand import theflows.jsonfound in theIntegration-Studiodirectory here in anew flow - Once imported, click on the
Asset Tokenisationtab and clickDeployat the top right
- Double click on the
Set Global Variablesmodule - Go to the
On Messagetab and input your noted down variables and clickDone
'privateKey': '0x...',
'contract': '0x...',
'bpassKey': 'bpaas-...',
'rpcEndpoint': 'https://...',
'abi': []- Click on
Deployat the top right and click on the blue button next to theinjectmodule, next toSet Global Variablesmodule. - You can view the output at the debug window on the right side by clicking on the bug icon.
- Double click on the
injectmodule next to theInitialise Assetmodule - Input your variables and click
Done
msg.assetName = ''
msg.assetSymbol = ''
msg.assetUri = ''- Click on
Deployat the top right and click on the blue button next to theinjectmodule, next toInitialise Assetmodule. - 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
injectmodule, next to theCurrent Time + 10 Minutesmodule - You can view the output at the debug window on the right side by clicking on the bug icon. Take note of the
endvalue. This will be used as the maturity time input for the next step.
- Double click on the inject module next to the
Create Assetmodule - 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
injectmodule, next to theView Assetmodule - 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 Assetmodule - Input your variables and click
Done
msg.assetId = e.g. 1
msg.amounts = e.g. 10
msg.recipient = e.g. recipient address - Click on
Deployat the top right and click on the blue button next to theinjectmodule, next toMint Assetmodule. - 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
injectmodule, next to theView Balancemodule - 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