Skip to content

Commit

Permalink
Merge pull request #338 from cc7768/cc7768/across_fix_new_events
Browse files Browse the repository at this point in the history
BUG: Finish adapter fix
  • Loading branch information
vrtnd authored Feb 8, 2025
2 parents 576f6fc + d0cac41 commit e269411
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/adapters/across/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type SupportedChains = keyof typeof contracts;

// Add helper function
function bytes32ToAddress(bytes32: string) {
return ethers.utils.getAddress('0x' + bytes32.slice(26));
return ethers.utils.getAddress('0x' + bytes32.slice(26))
}

// "Version 3.5" events
Expand All @@ -82,6 +82,9 @@ const depositParamsv3p5: PartialContractEventParams = {
txHash: "transactionHash",
},
argKeys: {
to: "recipient",
from: "depositor",
token: "inputToken",
amount: "inputAmount",
},
argGetters: {
Expand All @@ -104,9 +107,13 @@ const relaysParamsv3p5: PartialContractEventParams = {
txHash: "transactionHash",
},
argKeys: {
to: "recipient",
from: "depositor",
token: "outputToken",
amount: "outputAmount",
},
argGetters: {
// to: (logArgs: any) => bytes32ToAddress(logArgs.recipient),
to: (logArgs: any) => bytes32ToAddress(logArgs.recipient),
from: (logArgs: any) => bytes32ToAddress(logArgs.depositor),
token: (logArgs: any) => bytes32ToAddress(logArgs.outputToken)
Expand Down Expand Up @@ -306,16 +313,16 @@ const constructParams = (chain: SupportedChains) => {

const adapter: BridgeAdapter = {
ethereum: constructParams("ethereum"),
optimism: constructParams("optimism"),
polygon: constructParams("polygon"),
"zksync era": constructParams("era"),
// optimism: constructParams("optimism"),
// polygon: constructParams("polygon"),
// "zksync era": constructParams("era"),
// lisk: constructParams("lisk"),
base: constructParams("base"),
mode: constructParams("mode"),
arbitrum: constructParams("arbitrum"),
linea: constructParams("linea"),
blast: constructParams("blast"),
scroll: constructParams("scroll"),
// base: constructParams("base"),
// mode: constructParams("mode"),
// arbitrum: constructParams("arbitrum"),
// linea: constructParams("linea"),
// blast: constructParams("blast"),
// scroll: constructParams("scroll"),
};

export default adapter;

0 comments on commit e269411

Please sign in to comment.