diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index 3977f1c..8d649b4 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -16,7 +16,7 @@ jobs: # - https://gh.io/supported-runners-and-hardware-resources # - https://gh.io/using-larger-runners # Consider using larger runners for possible analysis time improvements. - runs-on: 'ubuntu-latest-4-cores' + runs-on: ubuntu-latest timeout-minutes: 30 permissions: security-events: write @@ -48,7 +48,7 @@ jobs: - name: Autobuild uses: github/codeql-action/autobuild@v3 - continue-on-error: true + continue-on-error: true - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/deploy_and_release.yml b/.github/workflows/deploy_and_release.yml index 641845c..74c7b76 100644 --- a/.github/workflows/deploy_and_release.yml +++ b/.github/workflows/deploy_and_release.yml @@ -21,6 +21,7 @@ jobs: PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT }} PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT_BACKUP: ${{ secrets.PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT_BACKUP }} PRIVATE_KEY_FOR_V1_WALLET_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_V1_WALLET_CONTRACT_DEPLOYMENT }} + PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT }} QUICKNODE_ETH_MAINNET_API_KEY: ${{ secrets.QUICKNODE_ETH_MAINNET_API_KEY }} QUICKNODE_ETH_HOLESKY_API_KEY: ${{ secrets.QUICKNODE_ETH_HOLESKY_API_KEY }} QUICKNODE_ARBITRUM_SEPOLIA_API_KEY: ${{ secrets.QUICKNODE_ARBITRUM_SEPOLIA_API_KEY }} @@ -38,7 +39,7 @@ jobs: BASESCAN_API_KEY: ${{ secrets.BASESCAN_API_KEY }} BARTIO_BERA_EXPLORER_API_KEY: ${{ secrets.BARTIO_BERA_EXPLORER_API_KEY }} OAS_EXPLORER_API_KEY: ${{ secrets.OAS_EXPLORER_API_KEY }} - CORE_DAO_EXPLORER_API_KEY: ${{ secrets.CORE_DAO_EXPLORER_API_KEY }} + CORE_DAO_TESTNET_EXPLORER_API_KEY: ${{ secrets.CORE_DAO_TESTNET_EXPLORER_API_KEY }} get-network: runs-on: ubuntu-latest needs: [lint-and-test] @@ -76,6 +77,7 @@ jobs: PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT }} PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT_BACKUP: ${{ secrets.PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT_BACKUP }} PRIVATE_KEY_FOR_V1_WALLET_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_V1_WALLET_CONTRACT_DEPLOYMENT }} + PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT }} QUICKNODE_ETH_HOLESKY_API_KEY: ${{ secrets.QUICKNODE_ETH_HOLESKY_API_KEY }} QUICKNODE_ARBITRUM_SEPOLIA_API_KEY: ${{ secrets.QUICKNODE_ARBITRUM_SEPOLIA_API_KEY }} QUICKNODE_OPTIMISM_SEPOLIA_API_KEY: ${{ secrets.QUICKNODE_OPTIMISM_SEPOLIA_API_KEY }} @@ -90,7 +92,7 @@ jobs: BASESCAN_API_KEY: ${{ secrets.BASESCAN_API_KEY }} BARTIO_BERA_EXPLORER_API_KEY: ${{ secrets.BARTIO_BERA_EXPLORER_API_KEY }} OAS_EXPLORER_API_KEY: ${{ secrets.OAS_EXPLORER_API_KEY }} - CORE_DAO_EXPLORER_API_KEY: ${{ secrets.CORE_DAO_EXPLORER_API_KEY }} + CORE_DAO_TESTNET_EXPLORER_API_KEY: ${{ secrets.CORE_DAO_TESTNET_EXPLORER_API_KEY }} - name: Update release notes uses: actions/github-script@v6 with: @@ -139,6 +141,7 @@ jobs: PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT }} PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT_BACKUP: ${{ secrets.PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT_BACKUP }} PRIVATE_KEY_FOR_V1_WALLET_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_V1_WALLET_CONTRACT_DEPLOYMENT }} + PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT }} QUICKNODE_ETH_MAINNET_API_KEY: ${{ secrets.QUICKNODE_ETH_MAINNET_API_KEY }} ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} ALCHEMY_POLYGON_API_KEY: ${{ secrets.ALCHEMY_POLYGON_API_KEY }} diff --git a/.github/workflows/deploy_batcher_contract.yml b/.github/workflows/deploy_batcher_contract.yml index f09ff09..4b33a73 100644 --- a/.github/workflows/deploy_batcher_contract.yml +++ b/.github/workflows/deploy_batcher_contract.yml @@ -16,6 +16,11 @@ jobs: - run: npm run lint - run: npm run test env: + MAINNET_PRIVATE_KEY_FOR_CONTRACT_DEPLOYMENT: ${{ secrets.MAINNET_PRIVATE_KEY_FOR_CONTRACT_DEPLOYMENT }} + TESTNET_PRIVATE_KEY_FOR_CONTRACT_DEPLOYMENT: ${{ secrets.TESTNET_PRIVATE_KEY_FOR_CONTRACT_DEPLOYMENT }} + PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT }} + PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT_BACKUP: ${{ secrets.PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT_BACKUP }} + PRIVATE_KEY_FOR_V1_WALLET_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_V1_WALLET_CONTRACT_DEPLOYMENT }} PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT }} QUICKNODE_ETH_MAINNET_API_KEY: ${{ secrets.QUICKNODE_ETH_MAINNET_API_KEY }} QUICKNODE_ETH_HOLESKY_API_KEY: ${{ secrets.QUICKNODE_ETH_HOLESKY_API_KEY }} @@ -34,7 +39,7 @@ jobs: BASESCAN_API_KEY: ${{ secrets.BASESCAN_API_KEY }} BARTIO_BERA_EXPLORER_API_KEY: ${{ secrets.BARTIO_BERA_EXPLORER_API_KEY }} OAS_EXPLORER_API_KEY: ${{ secrets.OAS_EXPLORER_API_KEY }} - CORE_DAO_EXPLORER_API_KEY: ${{ secrets.CORE_DAO_EXPLORER_API_KEY }} + CORE_DAO_TESTNET_EXPLORER_API_KEY: ${{ secrets.CORE_DAO_TESTNET_EXPLORER_API_KEY }} get-network: runs-on: ubuntu-latest needs: [lint-and-test] @@ -71,6 +76,11 @@ jobs: - run: npm install - run: npm run deploy-batcher --network ${{ needs.get-network.outputs.network }} env: + MAINNET_PRIVATE_KEY_FOR_CONTRACT_DEPLOYMENT: ${{ secrets.MAINNET_PRIVATE_KEY_FOR_CONTRACT_DEPLOYMENT }} + TESTNET_PRIVATE_KEY_FOR_CONTRACT_DEPLOYMENT: ${{ secrets.TESTNET_PRIVATE_KEY_FOR_CONTRACT_DEPLOYMENT }} + PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT }} + PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT_BACKUP: ${{ secrets.PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT_BACKUP }} + PRIVATE_KEY_FOR_V1_WALLET_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_V1_WALLET_CONTRACT_DEPLOYMENT }} PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT }} QUICKNODE_ETH_HOLESKY_API_KEY: ${{ secrets.QUICKNODE_ETH_HOLESKY_API_KEY }} QUICKNODE_ARBITRUM_SEPOLIA_API_KEY: ${{ secrets.QUICKNODE_ARBITRUM_SEPOLIA_API_KEY }} @@ -86,7 +96,7 @@ jobs: BASESCAN_API_KEY: ${{ secrets.BASESCAN_API_KEY }} BARTIO_BERA_EXPLORER_API_KEY: ${{ secrets.BARTIO_BERA_EXPLORER_API_KEY }} OAS_EXPLORER_API_KEY: ${{ secrets.OAS_EXPLORER_API_KEY }} - CORE_DAO_EXPLORER_API_KEY: ${{ secrets.CORE_DAO_EXPLORER_API_KEY }} + CORE_DAO_TESTNET_EXPLORER_API_KEY: ${{ secrets.CORE_DAO_TESTNET_EXPLORER_API_KEY }} - name: Update release notes uses: actions/github-script@v7 with: @@ -110,6 +120,11 @@ jobs: - run: npm install - run: npm run deploy-batcher --network ${{ needs.get-network.outputs.network }} env: + MAINNET_PRIVATE_KEY_FOR_CONTRACT_DEPLOYMENT: ${{ secrets.MAINNET_PRIVATE_KEY_FOR_CONTRACT_DEPLOYMENT }} + TESTNET_PRIVATE_KEY_FOR_CONTRACT_DEPLOYMENT: ${{ secrets.TESTNET_PRIVATE_KEY_FOR_CONTRACT_DEPLOYMENT }} + PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT }} + PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT_BACKUP: ${{ secrets.PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT_BACKUP }} + PRIVATE_KEY_FOR_V1_WALLET_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_V1_WALLET_CONTRACT_DEPLOYMENT }} PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT }} QUICKNODE_ETH_MAINNET_API_KEY: ${{ secrets.QUICKNODE_ETH_MAINNET_API_KEY }} ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 827807e..74b2ae9 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -29,6 +29,7 @@ jobs: PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT }} PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT_BACKUP: ${{ secrets.PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT_BACKUP }} PRIVATE_KEY_FOR_V1_WALLET_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_V1_WALLET_CONTRACT_DEPLOYMENT }} + PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT: ${{ secrets.PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT }} QUICKNODE_ETH_MAINNET_API_KEY: ${{ secrets.QUICKNODE_ETH_MAINNET_API_KEY }} QUICKNODE_ETH_HOLESKY_API_KEY: ${{ secrets.QUICKNODE_ETH_HOLESKY_API_KEY }} QUICKNODE_ARBITRUM_SEPOLIA_API_KEY: ${{ secrets.QUICKNODE_ARBITRUM_SEPOLIA_API_KEY }} @@ -46,5 +47,5 @@ jobs: BASESCAN_API_KEY: ${{ secrets.BASESCAN_API_KEY }} BARTIO_BERA_EXPLORER_API_KEY: ${{ secrets.BARTIO_BERA_EXPLORER_API_KEY }} OAS_EXPLORER_API_KEY: ${{ secrets.OAS_EXPLORER_API_KEY }} - CORE_DAO_EXPLORER_API_KEY: ${{ secrets.CORE_DAO_EXPLORER_API_KEY }} + CORE_DAO_TESTNET_EXPLORER_API_KEY: ${{ secrets.CORE_DAO_TESTNET_EXPLORER_API_KEY }} - run: npm run lint diff --git a/hardhat.config.ts b/hardhat.config.ts index ed7ac4a..3bc3e16 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -32,7 +32,7 @@ const { BASESCAN_API_KEY, BARTIO_BERA_EXPLORER_API_KEY, OAS_EXPLORER_API_KEY, - CORE_DAO_EXPLORER_API_KEY + CORE_DAO_TESTNET_EXPLORER_API_KEY } = process.env; const config: HardhatUserConfig = { @@ -138,11 +138,19 @@ const config: HardhatUserConfig = { }, toas: { url: `https://rpc.testnet.oasys.games`, - accounts: [`${PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT}`] + accounts: [ + `${PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT}`, + `${PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT}`, + `${PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT}` + ] }, tcoredao: { url: `https://rpc.test.btcs.network`, - accounts: [`${PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT}`] + accounts: [ + `${PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT}`, + `${PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT}`, + `${PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT}` + ] }, tavaxc: { url: 'https://api.avax-test.network/ext/C/rpc', @@ -185,7 +193,7 @@ const config: HardhatUserConfig = { //OAS oasTestnet: `${OAS_EXPLORER_API_KEY}`, //Core Dao - coredaoTestnet: `${CORE_DAO_EXPLORER_API_KEY}`, + coredaoTestnet: `${CORE_DAO_TESTNET_EXPLORER_API_KEY}`, //avaxc // there is free api key for avaxc, so make use of 2 req/sec avaxc: 'sampleapikey', @@ -253,7 +261,7 @@ const config: HardhatUserConfig = { network: 'coredaoTestnet', chainId: 1115, urls: { - apiURL: 'https://scan.test.btcs.network/api', + apiURL: 'https://api.test.btcs.network/api', browserURL: 'https://scan.test.btcs.network' } }, diff --git a/scripts/deployBatcherContract.ts b/scripts/deployBatcherContract.ts index 67c5c14..2bf126b 100644 --- a/scripts/deployBatcherContract.ts +++ b/scripts/deployBatcherContract.ts @@ -10,7 +10,12 @@ async function main() { const contractName = 'Batcher'; const transferGasLimit = '200000'; - const Batcher = await ethers.getContractFactory(contractName); + const signers = await ethers.getSigners(); + const batcherDeployer = signers[2]; + const Batcher = await ethers.getContractFactory( + contractName, + batcherDeployer + ); const batcher = await Batcher.deploy(transferGasLimit); await batcher.deployed(); output.batcher = batcher.address;