Skip to content

Stores all transfer definitions supported by the vector protocol

License

Notifications You must be signed in to change notification settings

connext/transfers

Repository files navigation

Transfers

Stores all transfer definitions supported by the vector protocol.

Background

// TODO

Adding Transfers

To add a new transfer definition, you must submit a pull request that includes the following:

  • A .sol file defining your transfer logic. This should implement the ITransferDefinition interface, defined here
  • Tests for your transfer definition
  • An address of your deployed contract for the networks you want the transfer to be supported on (rinkeby, mainnet, goerli, etc.)

See the hashlock or withdraw directories for examples.

Running Tests

To run the tests, do the following:

  1. Install all dependencies:
> npm i
  1. Build the repo
> npm run build
  1. Run tests
> npm run test

Working with a local vector stack

Transfers added to this repository will NOT be included in the default vector contract deployment when working with a local vector deployment.

To deploy these contracts and add them to the local network, do the following:

  1. Start up vector locally (whichever stack you wish, but at least make sure the global stack is running):
~/vector > make start # can be make start-trio, make start-duet, or make start-global as well
  1. Update the transferNames array in the scripts/deploy.ts file to include all the transfer names you would like to deploy and register locally:
// Update the `transferNames` variable in ~/transfers/scripts/deploy.ts
// i.e. deploying Withdraw and Hashlock
const transferNames = ["HashlockTransfer", "Withdraw"];
// ...
  1. From the root of this repository, deploy the transfers to the running chain (will by default have chainId 1337):
~/transfers > npx hardhat run scripts/deploy.ts --network ganache
  1. Manually update the ~/vector/.chaindata/address-book.json file to include the printed address-book entry information from the script output

  2. Register the transfer with the deployed TransferRegistry:

~/transfers > npx transfer register --transfer-address 0x... --registry-address 0x...

About

Stores all transfer definitions supported by the vector protocol

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published