Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
Polygon Mumbai test deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
boyuanx committed Nov 6, 2023
1 parent ce621d8 commit 2500bf1
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 4 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions deployments/polygonMumbai/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
80001
111 changes: 111 additions & 0 deletions deployments/polygonMumbai/SimpleStorage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"address": "0x2906d67A0929e1E6C9102AA4d97e1f1F9B112153",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "string",
"name": "data",
"type": "string"
}
],
"name": "DidSetData",
"type": "event"
},
{
"inputs": [],
"name": "data",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "data_",
"type": "string"
}
],
"name": "setData",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0xa30c8694b8207bbb3b493411b72057ddaf3d4cccef7bf1efdf5182d17dacf548",
"receipt": {
"to": null,
"from": "0x55D22d83752a9bE59B8959f97FCf3b2CAbca5094",
"contractAddress": "0x2906d67A0929e1E6C9102AA4d97e1f1F9B112153",
"transactionIndex": 1,
"gasUsed": "282775",
"logsBloom": "0x00000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000080020000000000000000001000000000000000000000000004000000000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000008000400000000000000100000",
"blockHash": "0x9f92cd365f448670396f8d50e66fd91cf9b9456f75df7c7a7925f676139e1e7b",
"transactionHash": "0xa30c8694b8207bbb3b493411b72057ddaf3d4cccef7bf1efdf5182d17dacf548",
"logs": [
{
"transactionIndex": 1,
"blockNumber": 41908889,
"transactionHash": "0xa30c8694b8207bbb3b493411b72057ddaf3d4cccef7bf1efdf5182d17dacf548",
"address": "0x0000000000000000000000000000000000001010",
"topics": [
"0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63",
"0x0000000000000000000000000000000000000000000000000000000000001010",
"0x00000000000000000000000055d22d83752a9be59b8959f97fcf3b2cabca5094",
"0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8"
],
"data": "0x0000000000000000000000000000000000000000000000000001a6dedb42eab6000000000000000000000000000000000000000000000000037531370b79ae9a000000000000000000000000000000000000000000002276a742b484ac38b06e00000000000000000000000000000000000000000000000003738a583036c3e4000000000000000000000000000000000000000000002276a7445b63877b9b24",
"logIndex": 2,
"blockHash": "0x9f92cd365f448670396f8d50e66fd91cf9b9456f75df7c7a7925f676139e1e7b"
}
],
"blockNumber": 41908889,
"cumulativeGasUsed": "303775",
"status": 1,
"byzantium": true
},
"args": [],
"numDeployments": 1,
"solcInputHash": "5449ec9b882a7c7d81dee28abcfd8b23",
"metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"data\",\"type\":\"string\"}],\"name\":\"DidSetData\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"data\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"data_\",\"type\":\"string\"}],\"name\":\"setData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/SimpleStorage.sol\":\"SimpleStorage\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/SimpleStorage.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.20;\\n\\ncontract SimpleStorage {\\n string public data;\\n\\n event DidSetData(string data);\\n\\n function setData(string calldata data_) external {\\n data = data_;\\n emit DidSetData(data);\\n }\\n}\\n\",\"keccak256\":\"0x685a3fc09f3f7f3e1e8621e89e5671af84fb26515e01709295adf619f9489217\",\"license\":\"UNLICENSED\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50610427806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806347064d6a1461003b57806373d4a13a14610050575b600080fd5b61004e610049366004610146565b61006e565b005b6100586100b8565b60405161006591906101b8565b60405180910390f35b600061007b8284836102a5565b507f0aa27bc969ca2f2c0231e7e735818c143ba3cb7c69477e1d2ecddf587506430f60006040516100ac9190610366565b60405180910390a15050565b600080546100c59061021c565b80601f01602080910402602001604051908101604052809291908181526020018280546100f19061021c565b801561013e5780601f106101135761010080835404028352916020019161013e565b820191906000526020600020905b81548152906001019060200180831161012157829003601f168201915b505050505081565b6000806020838503121561015957600080fd5b823567ffffffffffffffff8082111561017157600080fd5b818501915085601f83011261018557600080fd5b81358181111561019457600080fd5b8660208285010111156101a657600080fd5b60209290920196919550909350505050565b600060208083528351808285015260005b818110156101e5578581018301518582016040015282016101c9565b506000604082860101526040601f19601f8301168501019250505092915050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061023057607f821691505b60208210810361025057634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156102a057600081815260208120601f850160051c8101602086101561027d5750805b601f850160051c820191505b8181101561029c57828155600101610289565b5050505b505050565b67ffffffffffffffff8311156102bd576102bd610206565b6102d1836102cb835461021c565b83610256565b6000601f84116001811461030557600085156102ed5750838201355b600019600387901b1c1916600186901b17835561035f565b600083815260209020601f19861690835b828110156103365786850135825560209485019460019092019101610316565b50868210156103535760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b600060208083526000845461037a8161021c565b8084870152604060018084166000811461039b57600181146103b5576103e3565b60ff1985168984015283151560051b8901830195506103e3565b896000528660002060005b858110156103db5781548b82018601529083019088016103c0565b8a0184019650505b50939897505050505050505056fea264697066735822122062f25627a0a210defd623ac17d8d1182deceecbefe1a7a5b5bb87078b169606764736f6c63430008140033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806347064d6a1461003b57806373d4a13a14610050575b600080fd5b61004e610049366004610146565b61006e565b005b6100586100b8565b60405161006591906101b8565b60405180910390f35b600061007b8284836102a5565b507f0aa27bc969ca2f2c0231e7e735818c143ba3cb7c69477e1d2ecddf587506430f60006040516100ac9190610366565b60405180910390a15050565b600080546100c59061021c565b80601f01602080910402602001604051908101604052809291908181526020018280546100f19061021c565b801561013e5780601f106101135761010080835404028352916020019161013e565b820191906000526020600020905b81548152906001019060200180831161012157829003601f168201915b505050505081565b6000806020838503121561015957600080fd5b823567ffffffffffffffff8082111561017157600080fd5b818501915085601f83011261018557600080fd5b81358181111561019457600080fd5b8660208285010111156101a657600080fd5b60209290920196919550909350505050565b600060208083528351808285015260005b818110156101e5578581018301518582016040015282016101c9565b506000604082860101526040601f19601f8301168501019250505092915050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061023057607f821691505b60208210810361025057634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156102a057600081815260208120601f850160051c8101602086101561027d5750805b601f850160051c820191505b8181101561029c57828155600101610289565b5050505b505050565b67ffffffffffffffff8311156102bd576102bd610206565b6102d1836102cb835461021c565b83610256565b6000601f84116001811461030557600085156102ed5750838201355b600019600387901b1c1916600186901b17835561035f565b600083815260209020601f19861690835b828110156103365786850135825560209485019460019092019101610316565b50868210156103535760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b600060208083526000845461037a8161021c565b8084870152604060018084166000811461039b57600181146103b5576103e3565b60ff1985168984015283151560051b8901830195506103e3565b896000528660002060005b858110156103db5781548b82018601529083019088016103c0565b8a0184019650505b50939897505050505050505056fea264697066735822122062f25627a0a210defd623ac17d8d1182deceecbefe1a7a5b5bb87078b169606764736f6c63430008140033",
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 3,
"contract": "contracts/SimpleStorage.sol:SimpleStorage",
"label": "data",
"offset": 0,
"slot": "0",
"type": "t_string_storage"
}
],
"types": {
"t_string_storage": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"language": "Solidity",
"sources": {
"contracts/SimpleStorage.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.20;\n\ncontract SimpleStorage {\n string public data;\n\n event DidSetData(string data);\n\n function setData(string calldata data_) external {\n data = data_;\n emit DidSetData(data);\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"abi",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers",
"metadata",
"storageLayout",
"devdoc",
"userdoc",
"evm.gasEstimates",
"storageLayout"
],
"": ["ast"]
}
},
"metadata": {
"useLiteralContent": true
}
}
}
18 changes: 18 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import '@openzeppelin/hardhat-upgrades'
import 'hardhat-storage-layout'
import 'hardhat-contract-sizer'
import 'hardhat-deploy'
import {config} from 'dotenv'

if (process.env.NODE_ENV !== 'PRODUCTION') {
config()
}

export default {
contractSizer: {
Expand All @@ -19,6 +24,14 @@ export default {
chainId: 33133,
allowUnlimitedContractSize: false,
loggingEnabled: true
},
polygonMumbai: {
url: 'https://rpc.ankr.com/polygon_mumbai',
chainId: 80001,
loggingEnabled: true,
accounts: [process.env.PRIVATE_KEY!],
saveDeployments: true,
zksync: false
}
},
solidity: {
Expand All @@ -38,5 +51,10 @@ export default {
deployer: {
default: 0
}
},
etherscan: {
apiKey: {
polygonMumbai: process.env.POLYGONSCAN_KEY
}
}
}
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@
"lint-staged": "15.0.2",
"prettier": "3.0.3",
"prettier-plugin-solidity": "1.1.3",
"solhint": "3.6.2",
"typescript": "5.2.2"
"solhint": "4.0.0",
"typescript": "5.2.2",
"dotenv": "^16.3.1",
"hardhat-deploy": "^0.11.43"
},
"dependencies": {
"bunyan": "^1.8.15",
"hardhat-deploy": "^0.11.43"
"bunyan": "^1.8.15"
}
}

0 comments on commit 2500bf1

Please sign in to comment.