code base for Cocos Creator with Ethereum smart contract connection
👤 KienDT
- Website: https://kiendt.me
- Github: @dotrungkien
- Compile SimpleStore smart contract
cd contract/
yarn
npx hardhat compile- run a local blockchain node, then copy a private key and import it to Metamask, make sure you choose
Localhost 8545as network on Metamask and see 10000 ETH in account balance.
npx hardhat node- change the network id on Metamask to 31337 (if needed)
- deploy Simple Storage to local blockchain node.
npx hardhat run scripts/deploy.js --network localhost- then save deployed address, for example:
0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9
-
Copy abi file from
contract/artifacts/SimpleStore.sol/SimpleStore.jsontogame/assets/contracts -
change
contractAddressingame/assets/Script/HelloWorld.jsby the address of Simple Store you deployed above -
run scene, change value and confirm transaction
- finally, transaction completed
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator



