parent
8c6411887c
commit
5155adb760
@ -1,258 +1,268 @@ |
||||
export const templates = (intl) => { |
||||
return [ |
||||
{ |
||||
name: "Generic", |
||||
items: [ |
||||
{ value: "remixDefault", displayName: intl.formatMessage({ id: 'filePanel.basic' }) }, |
||||
{ value: "blank", displayName: intl.formatMessage({ id: 'filePanel.blank' }) } |
||||
] |
||||
}, |
||||
{ |
||||
name: "OpenZeppelin", |
||||
items: [ |
||||
{ |
||||
value: "ozerc20", |
||||
displayName: "ERC20" |
||||
}, |
||||
{ |
||||
value: "ozerc721", |
||||
displayName: "ERC721 (NFT)" |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155" |
||||
}, |
||||
{ |
||||
value: "ozerc20", |
||||
displayName: "ERC20", |
||||
opts: { |
||||
mintable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc721", |
||||
displayName: "ERC721 (NFT)", |
||||
opts: { |
||||
mintable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155", |
||||
opts: { |
||||
mintable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc20", |
||||
displayName: "ERC20", |
||||
opts: { |
||||
mintable: true, |
||||
burnable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc721", |
||||
displayName: "ERC721 (NFT)", |
||||
opts: { |
||||
mintable: true, |
||||
burnable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155", |
||||
opts: { |
||||
mintable: true, |
||||
burnable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc20", |
||||
displayName: "ERC20", |
||||
opts: { |
||||
mintable: true, |
||||
pausable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc721", |
||||
displayName: "ERC721 (NFT)", |
||||
opts: { |
||||
mintable: true, |
||||
pausable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155", |
||||
opts: { |
||||
mintable: true, |
||||
pausable: true |
||||
} |
||||
return [ |
||||
{ |
||||
name: "Generic", |
||||
items: [ |
||||
{ value: "remixDefault", displayName: intl.formatMessage({ id: 'filePanel.basic' }) }, |
||||
{ value: "blank", displayName: intl.formatMessage({ id: 'filePanel.blank' }) } |
||||
] |
||||
}, |
||||
{ |
||||
name: "OpenZeppelin", |
||||
items: [ |
||||
{ |
||||
value: "ozerc20", |
||||
displayName: "ERC20" |
||||
}, |
||||
{ |
||||
value: "ozerc721", |
||||
displayName: "ERC721 (NFT)" |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155" |
||||
}, |
||||
{ |
||||
value: "ozerc20", |
||||
displayName: "ERC20", |
||||
opts: { |
||||
mintable: true |
||||
} |
||||
] |
||||
}, |
||||
{ |
||||
name: "OpenZeppelin Proxy", |
||||
items: [ |
||||
{ |
||||
value: "ozerc20", |
||||
displayName: "ERC20", |
||||
opts: { |
||||
upgradeable: 'uups' |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc721", |
||||
displayName: "ERC721 (NFT)", |
||||
opts: { |
||||
upgradeable: 'uups' |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155", |
||||
opts: { |
||||
upgradeable: 'uups' |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc20", |
||||
displayName: "ERC20", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc721", |
||||
displayName: "ERC721 (NFT)", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc20", |
||||
displayName: "ERC20", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true, |
||||
burnable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc721", |
||||
displayName: "ERC721 (NFT)", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true, |
||||
burnable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true, |
||||
burnable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc20", |
||||
displayName: "ERC20", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true, |
||||
pausable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc721", |
||||
displayName: "ERC721 (NFT)", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true, |
||||
pausable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true, |
||||
pausable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true, |
||||
burnable: true, |
||||
pausable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc721", |
||||
displayName: "ERC721 (NFT)", |
||||
opts: { |
||||
mintable: true |
||||
} |
||||
] |
||||
}, |
||||
{ |
||||
name: "OxProject", |
||||
items: [ |
||||
{ value: "zeroxErc20", displayName: "ERC20" } |
||||
] |
||||
}, |
||||
{ |
||||
name: "Gnosis Safe", |
||||
items: [ |
||||
{ value: "gnosisSafeMultisig", displayName: intl.formatMessage({ id: 'filePanel.multiSigWallet' }) } |
||||
] |
||||
}, |
||||
{ |
||||
name: "Circom ZKP", |
||||
items: [ |
||||
{ value: "semaphore", displayName: intl.formatMessage({ id: 'filePanel.semaphore' }) }, |
||||
{ value: "hashchecker", displayName: intl.formatMessage({ id: 'filePanel.hashchecker' }) }, |
||||
{ value: "rln", displayName: intl.formatMessage({ id: 'filePanel.rln' }) } |
||||
] |
||||
}, |
||||
{ |
||||
name: "Generic ZKP", |
||||
items: [ |
||||
{ value: "sindriScripts", displayName: intl.formatMessage({ id: 'filePanel.addscriptsindri' }) }, |
||||
] |
||||
}, |
||||
{ |
||||
name: "Uniswap V4", |
||||
items: [ |
||||
{ value: "uniswapV4Template", displayName: intl.formatMessage({ id: 'filePanel.uniswapV4Template' }) }, |
||||
{ value: "breakthroughLabsUniswapv4Hooks", displayName: intl.formatMessage({ id: 'filePanel.breakthroughLabsUniswapv4Hooks' }) }, |
||||
{ value: "uniswapV4HookBookMultiSigSwapHook", displayName: intl.formatMessage({ id: 'filePanel.uniswapV4HookBookMultiSigSwapHook' }) } |
||||
] |
||||
}, |
||||
{ |
||||
name: "Solidity CREATE2", |
||||
items: [ |
||||
{ value: "contractCreate2Factory", displayName: intl.formatMessage({ id: 'filePanel.addcreate2solidityfactory' }) }, |
||||
{ value: "contractDeployerScripts", displayName: intl.formatMessage({ id: 'filePanel.addscriptdeployer' }) } |
||||
] |
||||
}, |
||||
{ |
||||
name: "Contract Verification", |
||||
items: [ |
||||
{ value: "etherscanScripts", displayName: intl.formatMessage({ id: 'filePanel.addscriptetherscan' }) }, |
||||
] |
||||
} |
||||
] |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155", |
||||
opts: { |
||||
mintable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc20", |
||||
displayName: "ERC20", |
||||
opts: { |
||||
mintable: true, |
||||
burnable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc721", |
||||
displayName: "ERC721 (NFT)", |
||||
opts: { |
||||
mintable: true, |
||||
burnable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155", |
||||
opts: { |
||||
mintable: true, |
||||
burnable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc20", |
||||
displayName: "ERC20", |
||||
opts: { |
||||
mintable: true, |
||||
pausable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc721", |
||||
displayName: "ERC721 (NFT)", |
||||
opts: { |
||||
mintable: true, |
||||
pausable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155", |
||||
opts: { |
||||
mintable: true, |
||||
pausable: true |
||||
} |
||||
} |
||||
] |
||||
}, |
||||
{ |
||||
name: "OpenZeppelin Proxy", |
||||
items: [ |
||||
{ |
||||
value: "ozerc20", |
||||
displayName: "ERC20", |
||||
opts: { |
||||
upgradeable: 'uups' |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc721", |
||||
displayName: "ERC721 (NFT)", |
||||
opts: { |
||||
upgradeable: 'uups' |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155", |
||||
opts: { |
||||
upgradeable: 'uups' |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc20", |
||||
displayName: "ERC20", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc721", |
||||
displayName: "ERC721 (NFT)", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc20", |
||||
displayName: "ERC20", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true, |
||||
burnable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc721", |
||||
displayName: "ERC721 (NFT)", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true, |
||||
burnable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true, |
||||
burnable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc20", |
||||
displayName: "ERC20", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true, |
||||
pausable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc721", |
||||
displayName: "ERC721 (NFT)", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true, |
||||
pausable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true, |
||||
pausable: true |
||||
} |
||||
}, |
||||
{ |
||||
value: "ozerc1155", |
||||
displayName: "ERC1155", |
||||
opts: { |
||||
upgradeable: 'uups', |
||||
mintable: true, |
||||
burnable: true, |
||||
pausable: true |
||||
} |
||||
} |
||||
] |
||||
}, |
||||
{ |
||||
name: "OxProject", |
||||
items: [ |
||||
{ value: "zeroxErc20", displayName: "ERC20" } |
||||
] |
||||
}, |
||||
{ |
||||
name: "Gnosis Safe", |
||||
items: [ |
||||
{ value: "gnosisSafeMultisig", displayName: intl.formatMessage({ id: 'filePanel.multiSigWallet' }) } |
||||
] |
||||
}, |
||||
{ |
||||
name: "Circom ZKP", |
||||
items: [ |
||||
{ value: "semaphore", displayName: intl.formatMessage({ id: 'filePanel.semaphore' }) }, |
||||
{ value: "hashchecker", displayName: intl.formatMessage({ id: 'filePanel.hashchecker' }) }, |
||||
{ value: "rln", displayName: intl.formatMessage({ id: 'filePanel.rln' }) } |
||||
] |
||||
}, |
||||
{ |
||||
name: "Generic ZKP", |
||||
items: [ |
||||
{ value: "sindriScripts", displayName: intl.formatMessage({ id: 'filePanel.addscriptsindri' }) }, |
||||
] |
||||
}, |
||||
{ |
||||
name: "Uniswap V4", |
||||
items: [ |
||||
{ value: "uniswapV4Template", displayName: intl.formatMessage({ id: 'filePanel.uniswapV4Template' }) }, |
||||
{ value: "breakthroughLabsUniswapv4Hooks", displayName: intl.formatMessage({ id: 'filePanel.breakthroughLabsUniswapv4Hooks' }) }, |
||||
{ value: "uniswapV4HookBookMultiSigSwapHook", displayName: intl.formatMessage({ id: 'filePanel.uniswapV4HookBookMultiSigSwapHook' }) } |
||||
] |
||||
}, |
||||
{ |
||||
name: "Solidity CREATE2", |
||||
items: [ |
||||
{ value: "contractCreate2Factory", displayName: intl.formatMessage({ id: 'filePanel.addcreate2solidityfactory' }) }, |
||||
{ value: "contractDeployerScripts", displayName: intl.formatMessage({ id: 'filePanel.addscriptdeployer' }) } |
||||
] |
||||
}, |
||||
{ |
||||
name: "Contract Verification", |
||||
items: [ |
||||
{ value: "etherscanScripts", displayName: intl.formatMessage({ id: 'filePanel.addscriptetherscan' }) }, |
||||
], |
||||
|
||||
}, |
||||
{ |
||||
name: 'Github Actions', |
||||
items: [ |
||||
{ value: "runJsTestAction", displayName: intl.formatMessage({ id: 'filePanel.tssoltestghaction' }) }, |
||||
{ value: "runSolidityUnittestingAction", displayName: intl.formatMessage({ id: 'filePanel.tssoltestghaction' }) }, |
||||
{ value: "runSlitherAction", displayName: intl.formatMessage({ id: 'filePanel.slitherghaction' }) } |
||||
], |
||||
IsArtefact: true |
||||
} |
||||
] |
||||
} |
@ -0,0 +1,6 @@ |
||||
export const runJsTestAction = async (opts, plugin) => { |
||||
await plugin.call('fileManager', 'writeFile', |
||||
'.github/workflows/run-js-test.yml' , |
||||
// @ts-ignore
|
||||
(await import('!!raw-loader!./run-js-test.yml')).default) |
||||
} |
@ -0,0 +1,26 @@ |
||||
name: Running Mocha Chai Solidity Unit Tests |
||||
on: [push] |
||||
|
||||
jobs: |
||||
run_sample_test_job: |
||||
runs-on: ubuntu-latest |
||||
name: A job to run mocha and chai tests for solidity on github actions CI |
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@v2 |
||||
- name: Environment Setup |
||||
uses: actions/setup-node@v3 |
||||
with: |
||||
node-version: 20.0.0 |
||||
- name: Run Mocha Chai Unit Test Action |
||||
uses: EthereumRemix/ts-sol-test@v1.3.1 |
||||
with: |
||||
test-path: 'tests' |
||||
contract-path: 'contracts' |
||||
compiler-version: '0.8.7' |
||||
// evm-version: 'paris' |
||||
// optimize: true |
||||
// optimizer-runs: 200 |
||||
// node-url: 'https://mainnet.infura.io/v3/08b2a484451e4635a28b3d8234f24332' |
||||
// block-number: 'latest' |
||||
// hard-fork: 'merge' |
@ -0,0 +1,6 @@ |
||||
export const runSlitherAction = async (opts, plugin) => { |
||||
await plugin.call('fileManager', 'writeFile', |
||||
'.github/workflows/run-slither-action.yml' , |
||||
// @ts-ignore
|
||||
(await import('!!raw-loader!./run-slither-action.yml')).default) |
||||
} |
@ -0,0 +1,15 @@ |
||||
name: Slither Analysis |
||||
on: [push] |
||||
|
||||
jobs: |
||||
analyze: |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- uses: actions/checkout@v3 |
||||
- run: npm install |
||||
- uses: crytic/slither-action@v0.2.0 |
||||
with: |
||||
target: 'contracts' |
||||
slither-args: '--solc-remaps "@openzeppelin/contracts=./node_modules/@openzeppelin/contracts hardhat=./node_modules/hardhat"' |
||||
fail-on: 'low' |
||||
solc-version: '0.8.2' |
@ -0,0 +1,6 @@ |
||||
export const runSolidityUnittestingAction = async (opts, plugin) => { |
||||
await plugin.call('fileManager', 'writeFile', |
||||
'.github/workflows/run-solidity-unittesting.yml' , |
||||
// @ts-ignore
|
||||
(await import('!!raw-loader!./run-solidity-unittesting.yml')).default) |
||||
} |
@ -0,0 +1,25 @@ |
||||
name: Running Solidity Unit Tests |
||||
on: [push] |
||||
|
||||
jobs: |
||||
run_sol_contracts_job: |
||||
runs-on: ubuntu-latest |
||||
name: A job to run solidity unit tests on github actions CI |
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@v2 |
||||
- name: Environment Setup |
||||
uses: actions/setup-node@v3 |
||||
with: |
||||
node-version: 20.0.0 |
||||
- name: Run SUT Action |
||||
uses: EthereumRemix/sol-test@v1.1 |
||||
with: |
||||
test-path: 'tests' |
||||
compiler-version: '0.8.15' |
||||
// evm-version: 'paris' |
||||
// optimize: true |
||||
// optimizer-runs: 200 |
||||
// node-url: 'https://mainnet.infura.io/v3/08b2a484451e4635a28b3d8234f24332' |
||||
// block-number: 'latest' |
||||
// hard-fork: 'merge' |
Loading…
Reference in new issue