-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add ETH L2 contract address * Start withdraw implementation * Parse eth amount to wei * Sign and send withdraw transaction * Add address of messenger on L1 * Update types to U64 from ethers * Start finalize withdraw function * Add test for withdraw function * Change field name of Proof struct to merkle proof * Finish finalize withdraw function along with the test * Fix format * Add override struct to override transaction fields * Fix withdraw and test case * Delete estimate_gas function for ZKSProvider * Use L1 provider for finalize withdraw * Revert "Delete estimate_gas function for ZKSProvider" This reverts commit 70f68ef. * Add max fee per gas constant * Change endpoint name to avoid collision between L1 and L2 nodes * Fix transaction for finalize withdraw * Fix finalize withdraw test * Parse withdraw amount to wei * Cleanup * Add correct calculation for l2 to l1 log index * Clean the finalize withdraw function * Fix panic in finalize withdraw * Add a sleep to wait to the proof to be posted on L1. * Move send function to providers * Fix "unknown account" error * Fix finalize tx receipt * Use tokio for sleep when withdrawing * Add default value for gas * Fix clippy lints * Move send test to provider * Remove FIXME * Remove FIXME * Remove FIXME * Add another wallet in L1 for ZKSWallet creation * Add address as parameter in withdraw function * Fix clippy * Create DepositRequest structure * Implement other DepositRequest parameters * Make DepositRequest public * Use crate types * Fix gas limit setter * Fix gas_price setter * Fix operator tip setter * Fix l2_gas_limit setter * Fix gas_per_pubdata_byte setter * Remove unused sleeps * Fix operator_tip setter * Write ERC20 deposit test * Fix ERC20 deposit test * WIP ERC20 deposit implementation * Simplify ERC20 deposit test * Remove unused imports * WIP ERC20 deposit implementation * Include token approval call for erc20 deposit * Add dep on lazy static * Fix clippy errors * Fix clippy errors * Fix approve_erc20 * Skip ERC20 deposit test * Add newline at EOF * Fix lines that were removed by mistake * Remove outdated comment * Remove debug prints * Remove unnecesary setter call * Replace magic numbers with constants * Make ABI loader private so we can use expect calls - Why private? - This functionality is out of scope for our SDK. - It wasn't being used outside this module. - I think that it is ok to go with the simplest solution right now. We could refactor this to emit an error in the future if necessary. - It makes sense to use `expect`/`unwrap` here because the `include_str!` macro ensures that the ABI JSON string is present. * Make Ether the default token for deposit requests * Remove outdated comment * Fix ERC20 deposit test --------- Co-authored-by: IAvecilla <[email protected]> Co-authored-by: Iván Litteri <[email protected]> Co-authored-by: Martin Paulucci <[email protected]>
- Loading branch information
1 parent
e0ef89e
commit e396a30
Showing
15 changed files
with
11,392 additions
and
19 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,277 @@ | ||
[ | ||
{ | ||
"inputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "constructor" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "owner", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "spender", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": false, | ||
"internalType": "uint256", | ||
"name": "value", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "Approval", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "from", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "to", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": false, | ||
"internalType": "uint256", | ||
"name": "value", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "Transfer", | ||
"type": "event" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "owner", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "address", | ||
"name": "spender", | ||
"type": "address" | ||
} | ||
], | ||
"name": "allowance", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "spender", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "amount", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "approve", | ||
"outputs": [ | ||
{ | ||
"internalType": "bool", | ||
"name": "", | ||
"type": "bool" | ||
} | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "account", | ||
"type": "address" | ||
} | ||
], | ||
"name": "balanceOf", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "decimals", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint8", | ||
"name": "", | ||
"type": "uint8" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "spender", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "subtractedValue", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "decreaseAllowance", | ||
"outputs": [ | ||
{ | ||
"internalType": "bool", | ||
"name": "", | ||
"type": "bool" | ||
} | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "spender", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "addedValue", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "increaseAllowance", | ||
"outputs": [ | ||
{ | ||
"internalType": "bool", | ||
"name": "", | ||
"type": "bool" | ||
} | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "name", | ||
"outputs": [ | ||
{ | ||
"internalType": "string", | ||
"name": "", | ||
"type": "string" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "symbol", | ||
"outputs": [ | ||
{ | ||
"internalType": "string", | ||
"name": "", | ||
"type": "string" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "totalSupply", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "to", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "amount", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "transfer", | ||
"outputs": [ | ||
{ | ||
"internalType": "bool", | ||
"name": "", | ||
"type": "bool" | ||
} | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "from", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "address", | ||
"name": "to", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "amount", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "transferFrom", | ||
"outputs": [ | ||
{ | ||
"internalType": "bool", | ||
"name": "", | ||
"type": "bool" | ||
} | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
} | ||
] |
Oops, something went wrong.