-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0x trading testing script #361
Conversation
* adding unit tests * clean * fix build * update mocks * clean * clean Co-authored-by: Haythem Sellami <sellamihaythem96@gmail.com>
@haythem96 can you rebase your branch to the current master? It's been containing commit message from last Dec π |
|
||
console.log("Approving 0x Callee and calling Operate π") | ||
|
||
await callOption1.approve(trade0xCallee.address, optionsToMint, {from: taker}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we were going to use the permit callee for this approval?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Otoken in Kovan currently have no permit()
, so I just used the approve()
expiryDate.setUTCSeconds(0) | ||
expiry = new BigNumber(Math.floor(expiryDate.getTime() / 1000)) | ||
|
||
let callOption1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we also test put options? :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it is the same as the Trade0x is agnostic to what the option type is, it is the same asset/contract.
Task: 0x trading testing script
High Level Description
This PR add a script to test Gamma actions batched with 0x trading on Kovan testnet.
The script use two address:
The Taker account need to have at least 1USDC and few ETH to approve USDC transfer.
The Maker account need to have at least 1ETH to collateralize the minted option + few ETH for 0x and transaction fees.
Also this PR add a bunch of scripts that help interacting with the protocol:
Usage:
truffle exec scripts/trade0x-kovan.js --network kovan --makerPrivateKey 0x0000...
where
makerPrivateKey
is the account private key used to sign 0x order.Output:
Code
Documentation