https://github.com/oraidex/evm-bridge-proxy
https://github.com/oraidex/evm-bridge-proxy
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/oraidex/evm-bridge-proxy
- Owner: oraidex
- Created: 2023-08-14T08:27:55.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-05-15T16:06:50.000Z (about 1 year ago)
- Last Synced: 2025-08-10T04:46:12.700Z (12 months ago)
- Language: Solidity
- Size: 672 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pre-requisites
- An Ethereum wallet private key, which will be the only wallet able to withdraw fees from the contract
- The wallet address (starting with 0x)
# To use this code
Create a file `.env` in the project root directory containing the wallet private keys (or mnemonic) and api key:
```bash
cd proxy-contract
yarn && yarn compile
```
# To deploy the contract on the Rinkeby testnet for the first time
```bash
yarn hardhat run --network rinkeby --config hardhat.config.ts scripts/deploy.js
```
Take note of the contract address for interacting with the smart contract from now on
Check the contract has been deployed on [Etherscan](https://rinkeby.etherscan.io)
# To make changes to the existing contract on Rinkeby
Update `scripts/upgrade.js` with the address of your recently deployed contract ☝️
Edit the contract code in `contracts/Swap.sol`
```bash
yarn hardhat run --network rinkeby scripts/upgrade.js
```
## To deploy the contract to a local blockchain
```bash
cd bridge-proxy-contract && yarn hardhat node # in a separate terminal window
yarn hardhat run --network localhost scripts/deploy.js
```
## To interact with the contract running on the local node using the command line
```bash
yarn 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(...);
```
## To interact with the contract running on the local node using JavaScript
```bash
yarn hardhat run --network localhost ./scripts/index.js
```
## To run the unit tests
```bash
yarn test
```
## Build and check
```bash
yarn -s contracts:analyze
yarn contracts:size
```