-
Notifications
You must be signed in to change notification settings - Fork 158
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
bug: OFT Arbitrum-Sepolia -> Sepolia Config Errors and OFT contract Gas Estimation Problems #709
Comments
Hey @berktec! Thanks for submitting an issue. As for the first problem, I see two things that could contribute to the problem:
Could you check those two please? Also I notice you mentioned you are using the |
Thanks for looking into this: so with 1. I changed to this with no difference in the error
For 2. I did not use the hardhat deploy to deploy the contracts, I opted for a different tool to get them on chain. and for your note at the bottom, that's true, and if I use either I get the same error still
|
Hey @berktec! Yeah that's the problem. We use There are several ways around this, depending on whether you want a quick solution or something more sturdy & possibly sustainable: Easy but fragileCreate a fake deployment files for your contracts, the only fields they need to contain are the E.g. put this into {
"address": "0xDee109faA9a53E6aBD3fE4ca2d1E423E4FC6D019",
"abi": [
/* You'll have to copy the ABI from the solc output /*
]
} More involved but sturdyWe use something we call an If you're not using // hardhat.config.ts
// These are the additional imports you'll need (you'll probably want to add these to your devDependencies)
import { Contract } from '@ethersproject/contracts'
import type { OmniContractFactory } from '@layerzerolabs/devtools-evm';
import { createConnectedContractFactory } from '@layerzerolabs/devtools-evm-hardhat';
import type { IOApp, OAppOmniGraph, OAppFactory } from '@layerzerolabs/ua-devtools'
import { createOAppFactory } from '@layerzerolabs/ua-devtools-evm'
import { createEndpointV2Factory } from '@layerzerolabs/protocol-devtools-evm'
import {
SUBTASK_LZ_OAPP_CONFIG_LOAD,
SUBTASK_LZ_OAPP_WIRE_CONFIGURE,
type SubtaskConfigureTaskArgs,
type SubtaskLoadConfigTaskArgs,
} from '@layerzerolabs/ua-devtools-evm-hardhat'
// We want to hook into the SUBTASK_LZ_OAPP_WIRE_CONFIGURE subtask
// that compiles the list of transactions that need to be submitted
// by comparing the on-chain information and your config
//
// This is the subtask that needs to know how to talk to the chain (i.e. it needs the SDK)
subtask(
SUBTASK_LZ_OAPP_WIRE_CONFIGURE,
'Configure GOD OFT',
(args: SubtaskConfigureTaskArgs<OAppOmniGraph, IOApp>, hre, runSuper) =>
runSuper({
...args,
// We want to override the sdkFactory and provide our own
//
// See the default implementation here https://github.com/stargate-protocol/stargate-v2/blob/main/packages/ua-devtools-evm/src/oapp/factory.ts
sdkFactory: createOAppFactory(
// We will wrap our contract factory with createConnectedContractFactory to attach providers to it
createConnectedContractFactory(myOFTContractFactory),
// createOAppFactory also requires and EndpointV2 SDK factory
//
// In the default implementation, it is optional and based on the contract factory above
// However, since we made that one only work with our specific OFT (i.e. it would not know where to get the EndpointV2 ABI),
// we need to supply the default one
createEndpointV2Factory(createConnectedContractFactory())
),
})
)
const myOFTContractFactory: OmniContractFactory = async ({ eid, address }) => {
// Here the goal is to grab your OFT's ABI and create an ether.js contract based on it
//
// You can go crazy here, make it very specific to your OFT or very generic
const abi = ...
return new Contract(address, abi)
} There are a couple of variations to this approach, most notably you can make |
Hey @berktec! Small update just to keep you in the loop. We are considering moving from The ABIs for the standard contracts will be embedded into the project so you'll no longer need to override any factories as such. It will take some time to work it in and, it being a breaking change, will also affect any code you might have written. |
Hi there,
Looking to deploy an OFT for multiple chains, but starting on Testnets of course. I have Both OFTs Deployed to Arbitrum-Sepolia and to ETH-Sepolia, and I have been facing two Errors.
Error: An error occurred while getting the OApp configuration: AssertionError [ERR_ASSERTION]: Could not find a deployment for address '0xa96b3749D01A50c4353f66455dBD92a52778C65A' on ARBSEP_V2_TESTNET (arbitrumSepolia)
This error occurs when attempting to run the wiring with this command:
npx hardhat lz:oapp:peers:get --oapp-config layerzero.config.ts
and this HardHat Config
and this layerzeroConfig.ts
Expected behavior
I would have expected in the first instance for the Configuration to find the Contract deployed on the Arbitrum Sepolia Network, as clearly the transactions and other infrastructure is functioning properly.
Both of the Contracts are IN-fact deployed and validated on testnets
https://sepolia.arbiscan.io/address/0xa96b3749D01A50c4353f66455dBD92a52778C65A
https://sepolia.etherscan.io/address/0xDee109faA9a53E6aBD3fE4ca2d1E423E4FC6D019
Screenshots
Environment (please complete the following information):
Additional context
Additional Context about the Insane Gas Price issue:
Here is the Task that I created to test the bridging between the two test nets:
The second Problem is when trying to bridge any more than 1-10 tokens the Gas fee quickly jumps from Dust essentially to 10x or more as constituted by this error from hardhat.
In Summary:
What am I missing in terms of configuration here to prevent the wild fluctuation in Gas Prices: and How can I get the Arbitrum Sepolia testnet to recognize the Contracts I have deployed to use these tools effectively
The text was updated successfully, but these errors were encountered: