Skip to content
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

Fix: linea pmfr #6302

Merged
merged 8 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const getProcessFromLineaRootArgs = async ({
} else {
throw new NoRootAvailable(spokeChainId, hubChainId, requestContext, methodContext, {
error: `Linea Unknown message status`,
hash: sendHash,
});
}
};
2 changes: 1 addition & 1 deletion packages/deployments/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@arbitrum/sdk": "3.1.11",
"@certusone/wormhole-sdk": "0.9.21",
"@connext/nxtp-utils": "workspace:*",
"@consensys/linea-sdk": "0.1.6",
"@consensys/linea-sdk": "0.3.0",
"@gelatonetwork/relay-context": "2.1.0",
"@mantleio/sdk": "1.0.0",
"@matterlabs/hardhat-zksync-deploy": "0.6.3",
Expand Down
26 changes: 12 additions & 14 deletions packages/deployments/contracts/tasks/connector/claimLinea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default task("claim-linea", "Claim messages on both of L1 and L2")
const deployer = Wallet.fromMnemonic(process.env.MAINNET_MNEMONIC ?? process.env.MNEMONIC!);

const env = mustGetEnv(_env);
const networkType = _networkType ?? ProtocolNetwork.TESTNET;
const networkType = _networkType ?? ProtocolNetwork.MAINNET;
console.log("networkType: ", networkType);
console.log("env:", env);
console.log("transaction hash", hash);
Expand All @@ -47,17 +47,18 @@ export default task("claim-linea", "Claim messages on both of L1 and L2")
});

// get L1/L2 contract
const originContract = chainId == hub.chain ? sdk.getL1Contract() : sdk.getL2Contract();
const originContract = chainId == hub.chain ? sdk.getL2Contract() : sdk.getL1Contract();

// get Message Status
const messages = await originContract.getMessagesByTransactionHash(hash);
console.log("messages: ", messages);

if (!messages?.length) {
throw new Error(`${hash} has no message sent`);
}
console.log("message: ", messages[0]);

const destContract = chainId == hub.chain ? sdk.getL2Contract() : sdk.getL1Contract();
const destContract = chainId == hub.chain ? sdk.getL1Contract() : sdk.getL2Contract();

// returns on-chain message status by message hash
const messageStatus = await destContract.getMessageStatus(messages[0].messageHash);
Expand All @@ -67,17 +68,14 @@ export default task("claim-linea", "Claim messages on both of L1 and L2")
console.log("message already claimed!! skipping...");
} else if (messageStatus === "CLAIMABLE") {
console.log("Claimable message status. ");
let claimMessage = await destContract.claim(
{
// claims message by message
...messages[0],
feeRecipient: deployer.address, // address that will receive fees. by default it is the message sender
},
{
gasPrice: utils.parseUnits("3", "gwei"),
},
);
console.log(claimMessage);
let claimMessage = await destContract.claim({
// claims message by message
...messages[0],
feeRecipient: deployer.address, // address that will receive fees. by default it is the message sender
});
console.log("claim:", claimMessage.hash);
const ret = await claimMessage.wait();
console.log("claim receipt:", ret);
} else {
console.log("unknown message status. skipping...");
}
Expand Down
Loading
Loading