diff --git a/.env.example b/.env.example index 89eaa40..a31ebb0 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,5 @@ PRIVATE_KEY= - +ENVIROMENT=test CREATE3_FACTORY_ADDRESS=0x93FEC2C00BfE902F733B57c5a6CeeD7CD1384AE1 # Public CREATE3 factory address # Mainnet RPCs diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9793a30..fa20107 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,6 +11,10 @@ jobs: - uses: actions/checkout@v3 with: submodules: recursive + - name: create env file + run: | + touch .env + echo ENVIRONMENT=test >> .env - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 - name: Install packages diff --git a/deployments/_deployments_log_file.json b/deployments/_deployments_log_file.json index 35c99c4..bbb3ae6 100644 --- a/deployments/_deployments_log_file.json +++ b/deployments/_deployments_log_file.json @@ -1,30 +1,30 @@ { "FulfillableRegistryProxy": { - "arbitrum": { + "bsc-testnet": { "staging": { "1.0.0": [ { "ADDRESS": "0xbFfd65600a7D15f1D4e6e2B8eeca583204748E50", "OPTIMIZER_RUNS": "1000000", - "TIMESTAMP": "2024-12-05 18:47:20", + "TIMESTAMP": "2024-12-05 18:58:57", "CONSTRUCTOR_ARGS": "0x000000000000000000000000fce257357e88bad8994a02af021edfead70c89a000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024c4d66de80000000000000000000000004c244916a0f0b4a54aa8377655b156d48f083aa500000000000000000000000000000000000000000000000000000000", "SALT": "27182818284590452353602874713555", - "VERIFIED": "false", + "VERIFIED": "true", "CONTRACT_FILE_PATH": "contracts/proxy/FulfillableRegistryProxy.sol", "CONTRACT_NAME": "FulfillableRegistryProxy" } ] } }, - "bsc-testnet": { + "arbitrum": { "staging": { "1.0.0": [ { - "ADDRESS": "0xbFfd65600a7D15f1D4e6e2B8eeca583204748E50", + "ADDRESS": "0xbc3512E1072C95E998Bb13c00d2F08048b1Ba311", "OPTIMIZER_RUNS": "1000000", - "TIMESTAMP": "2024-12-05 18:58:57", - "CONSTRUCTOR_ARGS": "0x000000000000000000000000fce257357e88bad8994a02af021edfead70c89a000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024c4d66de80000000000000000000000004c244916a0f0b4a54aa8377655b156d48f083aa500000000000000000000000000000000000000000000000000000000", - "SALT": "27182818284590452353602874713555", + "TIMESTAMP": "2024-12-18 17:59:20", + "CONSTRUCTOR_ARGS": "0x000000000000000000000000e873c736da1d47425d51b3b251dd88171519a47500000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024c4d66de80000000000000000000000004c244916a0f0b4a54aa8377655b156d48f083aa500000000000000000000000000000000000000000000000000000000", + "SALT": "27182818284590452353602874713556", "VERIFIED": "false", "CONTRACT_FILE_PATH": "contracts/proxy/FulfillableRegistryProxy.sol", "CONTRACT_NAME": "FulfillableRegistryProxy" @@ -34,31 +34,31 @@ } }, "FulfillableRegistry": { - "arbitrum": { + "bsc-testnet": { "staging": { "1.0.0": [ { "ADDRESS": "0xfCE257357e88BaD8994A02aF021EdFead70C89A0", "OPTIMIZER_RUNS": "1000000", - "TIMESTAMP": "2024-12-05 18:47:20", + "TIMESTAMP": "2024-12-05 18:58:57", "CONSTRUCTOR_ARGS": "0x", "SALT": "27182818284590452353602874713555", - "VERIFIED": "false", + "VERIFIED": "true", "CONTRACT_FILE_PATH": "contracts/periphery/registry/FulfillableRegistryV1.sol", "CONTRACT_NAME": "FulfillableRegistryV1" } ] } }, - "bsc-testnet": { + "arbitrum": { "staging": { "1.0.0": [ { - "ADDRESS": "0xfCE257357e88BaD8994A02aF021EdFead70C89A0", + "ADDRESS": "0xE873C736da1d47425D51b3B251dd88171519a475", "OPTIMIZER_RUNS": "1000000", - "TIMESTAMP": "2024-12-05 18:58:57", + "TIMESTAMP": "2024-12-18 17:59:20", "CONSTRUCTOR_ARGS": "0x", - "SALT": "27182818284590452353602874713555", + "SALT": "27182818284590452353602874713556", "VERIFIED": "false", "CONTRACT_FILE_PATH": "contracts/periphery/registry/FulfillableRegistryV1.sol", "CONTRACT_NAME": "FulfillableRegistryV1" @@ -68,32 +68,32 @@ } }, "ERC20TokenRegistryProxy": { - "arbitrum": { + "bsc-testnet": { "staging": { "1.0.0": [ { "ADDRESS": "0xbae783a06905F0c5B28450AeA36D075DE5F0b732", "OPTIMIZER_RUNS": "1000000", - "TIMESTAMP": "2024-12-05 18:48:41", + "TIMESTAMP": "2024-12-05 19:05:31", "CONSTRUCTOR_ARGS": "0x0000000000000000000000008626aefbdbb23d100cf4d0d31ac9200310f3decc00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024c4d66de80000000000000000000000004c244916a0f0b4a54aa8377655b156d48f083aa500000000000000000000000000000000000000000000000000000000", "SALT": "27182818284590452353602874713555", - "VERIFIED": "false", + "VERIFIED": "true", "CONTRACT_FILE_PATH": "contracts/proxy/ERC20TokenRegistryProxy.sol", "CONTRACT_NAME": "ERC20TokenRegistryProxy" } ] } }, - "bsc-testnet": { + "arbitrum": { "staging": { "1.0.0": [ { - "ADDRESS": "0xbae783a06905F0c5B28450AeA36D075DE5F0b732", + "ADDRESS": "0xB00A282a309958BA8cb6d8C266c05dF57C07A486", "OPTIMIZER_RUNS": "1000000", - "TIMESTAMP": "2024-12-05 19:05:31", - "CONSTRUCTOR_ARGS": "0x0000000000000000000000008626aefbdbb23d100cf4d0d31ac9200310f3decc00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024c4d66de80000000000000000000000004c244916a0f0b4a54aa8377655b156d48f083aa500000000000000000000000000000000000000000000000000000000", - "SALT": "27182818284590452353602874713555", - "VERIFIED": "false", + "TIMESTAMP": "2024-12-18 19:05:31", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "27182818284590452353602874713556", + "VERIFIED": "true", "CONTRACT_FILE_PATH": "contracts/proxy/ERC20TokenRegistryProxy.sol", "CONTRACT_NAME": "ERC20TokenRegistryProxy" } @@ -102,32 +102,32 @@ } }, "ERC20TokenRegistry": { - "arbitrum": { + "bsc-testnet": { "staging": { "1.0.0": [ { "ADDRESS": "0x8626AefbDbB23D100Cf4D0D31Ac9200310F3DECC", "OPTIMIZER_RUNS": "1000000", - "TIMESTAMP": "2024-12-05 18:48:41", + "TIMESTAMP": "2024-12-05 19:05:31", "CONSTRUCTOR_ARGS": "0x", "SALT": "27182818284590452353602874713555", - "VERIFIED": "false", + "VERIFIED": "true", "CONTRACT_FILE_PATH": "contracts/periphery/registry/ERC20TokenRegistryV1.sol", "CONTRACT_NAME": "ERC20TokenRegistryV1" } ] } }, - "bsc-testnet": { + "arbitrum": { "staging": { "1.0.0": [ { - "ADDRESS": "0x8626AefbDbB23D100Cf4D0D31Ac9200310F3DECC", + "ADDRESS": "0x343d9B83e016E193d7729d547619761a0607832B", "OPTIMIZER_RUNS": "1000000", - "TIMESTAMP": "2024-12-05 19:05:31", + "TIMESTAMP": "2024-12-18 19:05:31", "CONSTRUCTOR_ARGS": "0x", - "SALT": "27182818284590452353602874713555", - "VERIFIED": "false", + "SALT": "27182818284590452353602874713556", + "VERIFIED": "true", "CONTRACT_FILE_PATH": "contracts/periphery/registry/ERC20TokenRegistryV1.sol", "CONTRACT_NAME": "ERC20TokenRegistryV1" } @@ -140,11 +140,11 @@ "staging": { "1.0.0": [ { - "ADDRESS": "0xf92C7f0725eb6d000862bfa617F12A09d82b1670", + "ADDRESS": "0x0EEef62a8909F747b7303Ce7D484396C9378D630", "OPTIMIZER_RUNS": "1000000", - "TIMESTAMP": "2024-12-05 18:51:05", - "CONSTRUCTOR_ARGS": "0x0000000000000000000000005d5f3128012d8b84d124eee67f865311db6b398900000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024c4d66de80000000000000000000000004c244916a0f0b4a54aa8377655b156d48f083aa500000000000000000000000000000000000000000000000000000000", - "SALT": "27182818284590452353602874713555", + "TIMESTAMP": "2024-12-18 18:27:22", + "CONSTRUCTOR_ARGS": "0x0000000000000000000000006c6a9b139ad79d34571b61a9ff87fb780f95134800000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024c4d66de80000000000000000000000004c244916a0f0b4a54aa8377655b156d48f083aa500000000000000000000000000000000000000000000000000000000", + "SALT": "27182818284590452353602874713556", "VERIFIED": "false", "CONTRACT_FILE_PATH": "contracts/proxy/BandoERC20FulfillableProxy.sol", "CONTRACT_NAME": "BandoERC20FulfillableProxy" @@ -158,11 +158,11 @@ "staging": { "1.0.0": [ { - "ADDRESS": "0x5D5f3128012D8b84D124EEe67f865311Db6b3989", + "ADDRESS": "0x6C6a9B139AD79d34571b61A9fF87Fb780F951348", "OPTIMIZER_RUNS": "1000000", - "TIMESTAMP": "2024-12-05 18:51:05", + "TIMESTAMP": "2024-12-18 18:27:22", "CONSTRUCTOR_ARGS": "0x", - "SALT": "27182818284590452353602874713555", + "SALT": "27182818284590452353602874713556", "VERIFIED": "false", "CONTRACT_FILE_PATH": "contracts/BandoERC20FulfillableV1.sol", "CONTRACT_NAME": "BandoERC20FulfillableV1" @@ -176,11 +176,11 @@ "staging": { "1.0.0": [ { - "ADDRESS": "0x0F012f079974d1D87a95750AE1bd527CF7f73dA7", + "ADDRESS": "0x3421BB01939ACD1214C44b553fD05aabD7a43361", "OPTIMIZER_RUNS": "1000000", - "TIMESTAMP": "2024-12-05 18:52:02", - "CONSTRUCTOR_ARGS": "0x000000000000000000000000da94a1968e5982df19b934ea38840d91983ab7db00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024c4d66de80000000000000000000000004c244916a0f0b4a54aa8377655b156d48f083aa500000000000000000000000000000000000000000000000000000000", - "SALT": "27182818284590452353602874713555", + "TIMESTAMP": "2024-12-18 18:28:18", + "CONSTRUCTOR_ARGS": "0x0000000000000000000000003f3996536518c836eccf10c35e335cf4d3a241f900000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024c4d66de80000000000000000000000004c244916a0f0b4a54aa8377655b156d48f083aa500000000000000000000000000000000000000000000000000000000", + "SALT": "27182818284590452353602874713556", "VERIFIED": "false", "CONTRACT_FILE_PATH": "contracts/proxy/BandoFulfillableProxy.sol", "CONTRACT_NAME": "BandoFulfillableProxy" @@ -194,11 +194,11 @@ "staging": { "1.0.0": [ { - "ADDRESS": "0xdA94A1968e5982Df19b934eA38840d91983AB7dB", + "ADDRESS": "0x3F3996536518c836EccF10c35E335Cf4d3a241F9", "OPTIMIZER_RUNS": "1000000", - "TIMESTAMP": "2024-12-05 18:52:02", + "TIMESTAMP": "2024-12-18 18:28:18", "CONSTRUCTOR_ARGS": "0x", - "SALT": "27182818284590452353602874713555", + "SALT": "27182818284590452353602874713556", "VERIFIED": "false", "CONTRACT_FILE_PATH": "contracts/BandoFulfillableV1.sol", "CONTRACT_NAME": "BandoFulfillableV1" @@ -212,11 +212,11 @@ "staging": { "1.0.0": [ { - "ADDRESS": "0xcbe5EaE3eC7825E986C1Ed7ee0A97cDCf48dD013", + "ADDRESS": "0x234bb8e566243765E91BeDA3e2313d34616ed7D0", "OPTIMIZER_RUNS": "1000000", - "TIMESTAMP": "2024-12-05 18:53:15", - "CONSTRUCTOR_ARGS": "0x000000000000000000000000bf42e33ce69053ee3de89569fad4629da5e671cd00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024c4d66de80000000000000000000000004c244916a0f0b4a54aa8377655b156d48f083aa500000000000000000000000000000000000000000000000000000000", - "SALT": "27182818284590452353602874713555", + "TIMESTAMP": "2024-12-18 18:28:46", + "CONSTRUCTOR_ARGS": "0x00000000000000000000000090c10d3e1f7c3195b65ebfc2198f62662516d10800000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024c4d66de80000000000000000000000004c244916a0f0b4a54aa8377655b156d48f083aa500000000000000000000000000000000000000000000000000000000", + "SALT": "27182818284590452353602874713556", "VERIFIED": "false", "CONTRACT_FILE_PATH": "contracts/proxy/BandoFulfillmentManagerProxy.sol", "CONTRACT_NAME": "BandoFulfillmentManagerProxy" @@ -230,11 +230,11 @@ "staging": { "1.0.0": [ { - "ADDRESS": "0xBF42E33Ce69053Ee3dE89569FAd4629DA5e671Cd", + "ADDRESS": "0x90c10d3E1f7C3195b65ebFC2198f62662516d108", "OPTIMIZER_RUNS": "1000000", - "TIMESTAMP": "2024-12-05 18:53:15", + "TIMESTAMP": "2024-12-18 18:28:46", "CONSTRUCTOR_ARGS": "0x", - "SALT": "27182818284590452353602874713555", + "SALT": "27182818284590452353602874713556", "VERIFIED": "false", "CONTRACT_FILE_PATH": "contracts/BandoFulfillmentManagerV1.sol", "CONTRACT_NAME": "BandoFulfillmentManagerV1" @@ -248,11 +248,11 @@ "staging": { "1.0.0": [ { - "ADDRESS": "0x918162696EB2f91D58332Efc73e1b25909090967", + "ADDRESS": "0x15C5BbD8611F065c4f37b173AB14fcb568FC61bC", "OPTIMIZER_RUNS": "1000000", - "TIMESTAMP": "2024-12-05 18:53:59", - "CONSTRUCTOR_ARGS": "0x000000000000000000000000f5779f22e04efca0f7bf5d6bc4458b78bb58247e00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024c4d66de80000000000000000000000004c244916a0f0b4a54aa8377655b156d48f083aa500000000000000000000000000000000000000000000000000000000", - "SALT": "27182818284590452353602874713555", + "TIMESTAMP": "2024-12-18 18:29:24", + "CONSTRUCTOR_ARGS": "0x0000000000000000000000005b938360a2495133af6bc8cbcacd838edb59c42700000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024c4d66de80000000000000000000000004c244916a0f0b4a54aa8377655b156d48f083aa500000000000000000000000000000000000000000000000000000000", + "SALT": "27182818284590452353602874713556", "VERIFIED": "false", "CONTRACT_FILE_PATH": "contracts/proxy/BandoRouterProxy.sol", "CONTRACT_NAME": "BandoRouterProxy" @@ -266,11 +266,11 @@ "staging": { "1.0.0": [ { - "ADDRESS": "0xF5779F22e04EFcA0F7bf5D6BC4458b78bb58247E", + "ADDRESS": "0x5B938360a2495133aF6bc8cbCaCD838EdB59C427", "OPTIMIZER_RUNS": "1000000", - "TIMESTAMP": "2024-12-05 18:53:59", + "TIMESTAMP": "2024-12-18 18:29:24", "CONSTRUCTOR_ARGS": "0x", - "SALT": "27182818284590452353602874713555", + "SALT": "27182818284590452353602874713556", "VERIFIED": "false", "CONTRACT_FILE_PATH": "contracts/BandoRouterV1.sol", "CONTRACT_NAME": "BandoRouterV1" diff --git a/deployments/arbitrum.staging.json b/deployments/arbitrum.staging.json index 9fbf77b..e1135a0 100644 --- a/deployments/arbitrum.staging.json +++ b/deployments/arbitrum.staging.json @@ -1,14 +1,14 @@ { - "FulfillableRegistryProxy": "0xbFfd65600a7D15f1D4e6e2B8eeca583204748E50", - "FulfillableRegistry": "0xfCE257357e88BaD8994A02aF021EdFead70C89A0", - "ERC20TokenRegistryProxy": "0xbae783a06905F0c5B28450AeA36D075DE5F0b732", - "ERC20TokenRegistry": "0x8626AefbDbB23D100Cf4D0D31Ac9200310F3DECC", - "BandoERC20FulfillableProxy": "0xf92C7f0725eb6d000862bfa617F12A09d82b1670", - "BandoERC20Fulfillable": "0x5D5f3128012D8b84D124EEe67f865311Db6b3989", - "BandoFulfillableProxy": "0x0F012f079974d1D87a95750AE1bd527CF7f73dA7", - "BandoFulfillable": "0xdA94A1968e5982Df19b934eA38840d91983AB7dB", - "BandoFulfillmentManagerProxy": "0xcbe5EaE3eC7825E986C1Ed7ee0A97cDCf48dD013", - "BandoFulfillmentManager": "0xBF42E33Ce69053Ee3dE89569FAd4629DA5e671Cd", - "BandoRouterProxy": "0x918162696EB2f91D58332Efc73e1b25909090967", - "BandoRouter": "0xF5779F22e04EFcA0F7bf5D6BC4458b78bb58247E" + "FulfillableRegistryProxy": "0xbc3512E1072C95E998Bb13c00d2F08048b1Ba311", + "FulfillableRegistry": "0xE873C736da1d47425D51b3B251dd88171519a475", + "ERC20TokenRegistryProxy": "0xB00A282a309958BA8cb6d8C266c05dF57C07A486", + "ERC20TokenRegistry": "0x343d9B83e016E193d7729d547619761a0607832B", + "BandoERC20FulfillableProxy": "0x0EEef62a8909F747b7303Ce7D484396C9378D630", + "BandoERC20Fulfillable": "0x6C6a9B139AD79d34571b61A9fF87Fb780F951348", + "BandoFulfillableProxy": "0x3421BB01939ACD1214C44b553fD05aabD7a43361", + "BandoFulfillable": "0x3F3996536518c836EccF10c35E335Cf4d3a241F9", + "BandoFulfillmentManagerProxy": "0x234bb8e566243765E91BeDA3e2313d34616ed7D0", + "BandoFulfillmentManager": "0x90c10d3E1f7C3195b65ebFC2198f62662516d108", + "BandoRouterProxy": "0x15C5BbD8611F065c4f37b173AB14fcb568FC61bC", + "BandoRouter": "0x5B938360a2495133aF6bc8cbCaCD838EdB59C427" } \ No newline at end of file diff --git a/deployments/arbitrum.test.json b/deployments/arbitrum.test.json new file mode 100644 index 0000000..9fbf77b --- /dev/null +++ b/deployments/arbitrum.test.json @@ -0,0 +1,14 @@ +{ + "FulfillableRegistryProxy": "0xbFfd65600a7D15f1D4e6e2B8eeca583204748E50", + "FulfillableRegistry": "0xfCE257357e88BaD8994A02aF021EdFead70C89A0", + "ERC20TokenRegistryProxy": "0xbae783a06905F0c5B28450AeA36D075DE5F0b732", + "ERC20TokenRegistry": "0x8626AefbDbB23D100Cf4D0D31Ac9200310F3DECC", + "BandoERC20FulfillableProxy": "0xf92C7f0725eb6d000862bfa617F12A09d82b1670", + "BandoERC20Fulfillable": "0x5D5f3128012D8b84D124EEe67f865311Db6b3989", + "BandoFulfillableProxy": "0x0F012f079974d1D87a95750AE1bd527CF7f73dA7", + "BandoFulfillable": "0xdA94A1968e5982Df19b934eA38840d91983AB7dB", + "BandoFulfillmentManagerProxy": "0xcbe5EaE3eC7825E986C1Ed7ee0A97cDCf48dD013", + "BandoFulfillmentManager": "0xBF42E33Ce69053Ee3dE89569FAd4629DA5e671Cd", + "BandoRouterProxy": "0x918162696EB2f91D58332Efc73e1b25909090967", + "BandoRouter": "0xF5779F22e04EFcA0F7bf5D6BC4458b78bb58247E" +} \ No newline at end of file diff --git a/hardhat.config.js b/hardhat.config.js index f93d093..fd202bf 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -1,8 +1,35 @@ require("@nomicfoundation/hardhat-toolbox"); require('@openzeppelin/hardhat-upgrades'); require("@nomicfoundation/hardhat-foundry"); - +require("dotenv").config(); /** @type import('hardhat/config').HardhatUserConfig */ -module.exports = { - solidity: "0.8.28", -}; + +const createConfig = (env) => { + if(env != 'test') { + const privateKey = env === 'prod' ? process.env.PRIVATE_KEY_PRODUCTION : process.env.PRIVATE_KEY; + return { + solidity: "0.8.28", + networks: { + arbitrum: { + url: process.env.ETH_NODE_URI_ARBITRUM, + accounts: [privateKey], + protocolOwner: 'tbd', + managerOwner: 'tbd', + tokenRegistryOwner: 'tbd', + } + // Add more networks here + } + } + } else { + return { + solidity: "0.8.28", + networks: { + hardhat: { + chainId: 1337 + } + } + } + } +} + +module.exports = createConfig(process.env.ENVIRONMENT); diff --git a/package.json b/package.json index 6d7dee8..f256bdb 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "dependencies": { "@openzeppelin/contracts": "^5.0.2", "@openzeppelin/contracts-upgradeable": "^5.0.2", + "dotenv": "^16.4.7", "ethers": "^6.10.0", "solregex": "^0.3.1", "web3": "^4.14.0" diff --git a/scripts/configure_bfp.js b/scripts/configure_bfp.js new file mode 100644 index 0000000..d8ccc7c --- /dev/null +++ b/scripts/configure_bfp.js @@ -0,0 +1,157 @@ +// We require the Hardhat Runtime Environment explicitly here. This is optional +// but useful for running the script in a standalone fashion through `node