feat: ApprovalsManager trait
Make Permit2 and TokenApprovalsManager implement it. This way in the RouternEncoder we can use either one (I'm not exactly sure what this would mean in the contract though) I'm not sure I like this generalisation. The TokenApprovalsManager was made with a different purpose: to approve token allowances for the pools (like balancer and curve) for our router
This commit is contained in:
13
src/encoding/approvals/interface.rs
Normal file
13
src/encoding/approvals/interface.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
use num_bigint::BigUint;
|
||||
use tycho_core::Bytes;
|
||||
|
||||
pub struct Approval {
|
||||
pub spender: Bytes,
|
||||
pub owner: Bytes,
|
||||
pub token: Bytes,
|
||||
pub amount: BigUint,
|
||||
}
|
||||
|
||||
pub trait ApprovalsManager {
|
||||
fn encode_approvals(&self, approvals: Vec<Approval>) -> Vec<u8>;
|
||||
}
|
||||
Reference in New Issue
Block a user