use alloy_primitives::{Bytes, U256};
use alloy_sol_types::SolCall;
use super::relay::GMX_ROUTER;
use crate::deployments;
alloy_sol_types::sol! {
struct BridgeFeeParams {
address feeToken;
uint256 feeAmount;
address[] feeSwapPath;
uint256 minOutputAmount;
}
struct BridgeOutParams {
address token;
uint256 amount;
uint256 minAmountOut;
address provider;
bytes data;
BridgeFeeParams bridgeFee;
}
function transferOut(BridgeOutParams params);
}
pub const TRANSFER_ROUTER: alloy_primitives::Address = GMX_ROUTER;
pub fn transfer_out(amount: U256) -> Bytes {
let params = BridgeOutParams {
token: deployments::GMX.token,
amount,
minAmountOut: U256::ZERO,
provider: alloy_primitives::Address::ZERO,
data: Bytes::new(),
bridgeFee: BridgeFeeParams {
feeToken: alloy_primitives::Address::ZERO,
feeAmount: U256::ZERO,
feeSwapPath: Vec::new(),
minOutputAmount: U256::ZERO,
},
};
transferOutCall { params }.abi_encode().into()
}
#[cfg(test)]
mod tests;