Stores all transfer definitions supported by the vector protocol.
// TODO
To add a new transfer definition, you must submit a pull request that includes the following:
- A
.solfile defining your transfer logic. This should implement theITransferDefinitioninterface, 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.
To run the tests, do the following:
- Install all dependencies:
> npm i- Build the repo
> npm run build- Run tests
> npm run testTransfers 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:
- Start up vector locally (whichever stack you wish, but at least make sure the
globalstack is running):
~/vector > make start # can be make start-trio, make start-duet, or make start-global as well- Update the
transferNamesarray in thescripts/deploy.tsfile 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"];
// ...- From the root of this repository, deploy the transfers to the running chain (will by default have
chainId1337):
~/transfers > npx hardhat run scripts/deploy.ts --network ganache-
Manually update the
~/vector/.chaindata/address-book.jsonfile to include the printedaddress-bookentry information from the script output -
Register the transfer with the deployed
TransferRegistry:
~/transfers > npx transfer register --transfer-address 0x... --registry-address 0x...