Deploy Contract
Deploying and compiling the contract is different for the Polygon CDK, here we discuss the steps to deploy your first contract in the Polygon CDK network.
Step 1: Get the RPC URL - follow the instructions on the RPC Access page to get the RPC endpoints.
Step 2: Get ABI and bytecode - Deploying a contract in polygon CDK is the same as deploying a contract in the Ethereum network. You can compile the contract code in bytecode and abi normally as you would do for Ethereum and then can use it in the next step.
Step 3: Replace Values - Replace RPC_URL, contractAbi, contractBytecode and privateKey. once you replace those values with valid values, you can run the file with ts-node filename.ts
Step 4: Contract Address - Once it runs successfully you will get a contract address.
Last updated