- An Ethereum wallet private key, which will be the only wallet able to withdraw fees from the contract
- The wallet address (starting with 0x)
Create a file .env in the project root directory containing the wallet private keys (or mnemonic) and api key:
cd proxy-contract
yarn && yarn compileyarn hardhat run --network rinkeby --config hardhat.config.ts scripts/deploy.jsTake note of the contract address for interacting with the smart contract from now on
Check the contract has been deployed on Etherscan
Update scripts/upgrade.js with the address of your recently deployed contract ☝️
Edit the contract code in contracts/Swap.sol
yarn hardhat run --network rinkeby scripts/upgrade.jscd bridge-proxy-contract && yarn hardhat node # in a separate terminal window
yarn hardhat run --network localhost scripts/deploy.jsyarn hardhat run --network localhost scripts/upgrade.js
yarn hardhat console --network localhost
const factory = await ethers.getContractFactory('Swap');
const contract = await factory.attach('0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0');
await contract.swap(...);yarn hardhat run --network localhost ./scripts/index.jsyarn testyarn -s contracts:analyze
yarn contracts:size