Skip to content

Commit

Permalink
Migrate from truffle to hardhat - Close #AM-2912 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
zarifpour authored Dec 11, 2023
1 parent 3c8ec80 commit b23300c
Show file tree
Hide file tree
Showing 31 changed files with 12,476 additions and 18,350 deletions.
10 changes: 8 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
PRIVATE_KEY=""
PRIVATE_KEY="0f3456f7f1ed59aaa29f35f4674a87e754e1055249a2888bdaec3dea49d2e456"

MAINNET_NODE=""
GOERLI_NODE=""
POLYGON_NODE=""

ETHERSCAN_API_KEY=""
POLYGONSCAN_API_KEY=""

ADMIN_ADDRESS=""
COINMARKETCAP_API_KEY=""

ADMIN_ADDRESS=""

REPORT_GAS=true
6 changes: 6 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ env:
browser: true
commonjs: true
es2021: true
node: true
mocha: true

extends: standard

overrides: []

parserOptions:
ecmaVersion: latest

rules: {}
27 changes: 16 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
name: Truffle CI
name: CI

on:
push:
branches: [dev, master, main, wrapped-assets]
pull_request:
branches: [dev, master, main, wrapped-assets]
workflow_dispatch:

env:
MAINNET_NODE: ${{ secrets.MAINNET_NODE }}
GOERLI_NODE: ${{ secrets.GOERLI_NODE }}
POLYGON_NODE: ${{ secrets.POLYGON_NODE }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
PRIVATE_KEY: ${{ secrets.DUMMY_PK }}

jobs:
build:
coverage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: Setup NodeJS 18
uses: actions/setup-node@v2
Expand All @@ -21,14 +32,8 @@ jobs:
- name: Show NodeJS version
run: npm --version

- name: Checkout submodules
run: git submodule update --init --recursive

- name: Install Truffle
run: npm install -g truffle

- name: Install Project Dependencies
run: npm install

- name: Run Truffle Test
run: npm t
- name: Run Hardhat Tests
run: npx hardhat coverage
240 changes: 240 additions & 0 deletions .openzeppelin/goerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,26 @@
"address": "0x399508A43d7E2b4451cd344633108b4d84b33B03",
"txHash": "0xe1ab1ea53c208a83451842e246e3ace6ac176bfb3237b40c0fb98a2ff2135318",
"kind": "transparent"
},
{
"address": "0x033cc0Fd48ECE2364EFfce9745Af055D0B8A339A",
"txHash": "0x572054df9b21c35f3528d895c31fceb64298d945bf2ad25c6b1adf6cf17a0ee0",
"kind": "transparent"
},
{
"address": "0xd8d42193150763b51a8C5bD1F372Cb0e6A75DCf9",
"txHash": "0x1ba255cefcbe4de98f784109a4f73c1644f84be68723ae508b2c903f2e00f453",
"kind": "transparent"
},
{
"address": "0xA485323238cc8B4F6D589E3e22B34C58Ed304fFe",
"txHash": "0xf329e4d7d054ee868afe52deba8684cb1373d2da6cd3239e0e712343d9d814e3",
"kind": "transparent"
},
{
"address": "0xE7A42a3Bb406693d32810F853e3b6d77aFAEA9a7",
"txHash": "0x4cf41224ae783193a3f395690bac4236137bc9753f77cbf045336cf74d8943a5",
"kind": "transparent"
}
],
"impls": {
Expand Down Expand Up @@ -843,6 +863,226 @@
}
}
}
},
"946bbeec1ea22aaaeb7c7bd5038bbff42663e67c566214749561898491ffacba": {
"address": "0x73225F88fEEA4E41Fc67E986a95AC61dd7118866",
"txHash": "0xd070d6e0c8ee33104d5e2add61e7a1d857b9ab19b0e334e13c158f3a2881d3b0",
"layout": {
"solcVersion": "0.8.17",
"storage": [
{
"contract": "Initializable",
"label": "_initialized",
"type": "t_uint8",
"src": "../project:/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:62",
"retypedFrom": "bool"
},
{
"contract": "Initializable",
"label": "_initializing",
"type": "t_bool",
"src": "../project:/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:67"
},
{
"contract": "ContextUpgradeable",
"label": "__gap",
"type": "t_array(t_uint256)50_storage",
"src": "../project:/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol:36"
},
{
"contract": "PausableUpgradeable",
"label": "_paused",
"type": "t_bool",
"src": "../project:/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol:29"
},
{
"contract": "PausableUpgradeable",
"label": "__gap",
"type": "t_array(t_uint256)49_storage",
"src": "../project:/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol:116"
},
{
"contract": "ERC20Upgradeable",
"label": "_balances",
"type": "t_mapping(t_address,t_uint256)",
"src": "../project:/openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol:37"
},
{
"contract": "ERC20Upgradeable",
"label": "_allowances",
"type": "t_mapping(t_address,t_mapping(t_address,t_uint256))",
"src": "../project:/openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol:39"
},
{
"contract": "ERC20Upgradeable",
"label": "_totalSupply",
"type": "t_uint256",
"src": "../project:/openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol:41"
},
{
"contract": "ERC20Upgradeable",
"label": "_name",
"type": "t_string_storage",
"src": "../project:/openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol:43"
},
{
"contract": "ERC20Upgradeable",
"label": "_symbol",
"type": "t_string_storage",
"src": "../project:/openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol:44"
},
{
"contract": "ERC20Upgradeable",
"label": "__gap",
"type": "t_array(t_uint256)45_storage",
"src": "../project:/openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol:400"
},
{
"contract": "ERC165Upgradeable",
"label": "__gap",
"type": "t_array(t_uint256)50_storage",
"src": "../project:/openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol:41"
},
{
"contract": "AccessControlUpgradeable",
"label": "_roles",
"type": "t_mapping(t_bytes32,t_struct(RoleData)886_storage)",
"src": "../project:/openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol:61"
},
{
"contract": "AccessControlUpgradeable",
"label": "__gap",
"type": "t_array(t_uint256)49_storage",
"src": "../project:/openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol:259"
},
{
"contract": "AuthorizationModule",
"label": "__gap",
"type": "t_array(t_uint256)50_storage",
"src": "../project:/contracts/modules/security/AuthorizationModule.sol:57"
},
{
"contract": "BaseModule",
"label": "tokenId",
"type": "t_string_storage",
"src": "../project:/contracts/modules/wrapper/mandatory/BaseModule.sol:23"
},
{
"contract": "BaseModule",
"label": "terms",
"type": "t_string_storage",
"src": "../project:/contracts/modules/wrapper/mandatory/BaseModule.sol:24"
},
{
"contract": "BaseModule",
"label": "information",
"type": "t_string_storage",
"src": "../project:/contracts/modules/wrapper/mandatory/BaseModule.sol:25"
},
{
"contract": "BaseModule",
"label": "flag",
"type": "t_uint256",
"src": "../project:/contracts/modules/wrapper/mandatory/BaseModule.sol:26"
},
{
"contract": "BaseModule",
"label": "__gap",
"type": "t_array(t_uint256)50_storage",
"src": "../project:/contracts/modules/wrapper/mandatory/BaseModule.sol:109"
},
{
"contract": "PauseModule",
"label": "__gap",
"type": "t_array(t_uint256)50_storage",
"src": "../project:/contracts/modules/wrapper/mandatory/PauseModule.sol:67"
},
{
"contract": "MintModule",
"label": "__gap",
"type": "t_array(t_uint256)50_storage",
"src": "../project:/contracts/modules/wrapper/mandatory/MintModule.sol:51"
},
{
"contract": "BurnModule",
"label": "__gap",
"type": "t_array(t_uint256)50_storage",
"src": "../project:/contracts/modules/wrapper/mandatory/BurnModule.sol:51"
},
{
"contract": "ERC20BaseModule",
"label": "_decimals",
"type": "t_uint8",
"src": "../project:/contracts/modules/wrapper/mandatory/ERC20BaseModule.sol:16"
},
{
"contract": "ERC20BaseModule",
"label": "__gap",
"type": "t_array(t_uint256)50_storage",
"src": "../project:/contracts/modules/wrapper/mandatory/ERC20BaseModule.sol:90"
},
{
"contract": "CMTAT_BASE",
"label": "__gap",
"type": "t_array(t_uint256)50_storage",
"src": "../project:/contracts/modules/CMTAT_BASE.sol:139"
}
],
"types": {
"t_array(t_uint256)50_storage": {
"label": "uint256[50]"
},
"t_uint256": {
"label": "uint256"
},
"t_uint8": {
"label": "uint8"
},
"t_string_storage": {
"label": "string"
},
"t_mapping(t_bytes32,t_struct(RoleData)886_storage)": {
"label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)"
},
"t_bytes32": {
"label": "bytes32"
},
"t_struct(RoleData)886_storage": {
"label": "struct AccessControlUpgradeable.RoleData",
"members": [
{
"label": "members",
"type": "t_mapping(t_address,t_bool)"
},
{
"label": "adminRole",
"type": "t_bytes32"
}
]
},
"t_mapping(t_address,t_bool)": {
"label": "mapping(address => bool)"
},
"t_address": {
"label": "address"
},
"t_bool": {
"label": "bool"
},
"t_array(t_uint256)49_storage": {
"label": "uint256[49]"
},
"t_mapping(t_address,t_uint256)": {
"label": "mapping(address => uint256)"
},
"t_mapping(t_address,t_mapping(t_address,t_uint256))": {
"label": "mapping(address => mapping(address => uint256))"
},
"t_array(t_uint256)45_storage": {
"label": "uint256[45]"
}
}
}
}
}
}
21 changes: 21 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "solhint:recommended",
"plugins": ["prettier"],
"rules": {
"code-complexity": ["error", 11],
"compiler-version": ["error", ">=0.8.4"],
"func-visibility": ["error", { "ignoreConstructors": true }],
"immutable-vars-naming": ["warn", { "immutablesAsConstants": true }],
"max-line-length": ["error", 120],
"named-parameters-mapping": "warn",
"no-console": "off",
"custom-errors": "error",
"not-rely-on-time": "warn",
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
]
}
}
Loading

0 comments on commit b23300c

Please sign in to comment.