Guys i wrote a contract
In my contract i created interface to call function on other contract
But compiler do not let me compile because do not recognize function on other contract
What should i do?

Mar 17, 2023, 1:47 PM
your contract has access to the other contract's address and ABI ?
Mar 17, 2023, 1:49 PM
share screenshot
Mar 17, 2023, 1:53 PM
Yes i made interface
And gives its address to constructor
Mar 17, 2023, 1:57 PM
can you share screenshot of the error or no?
Mar 17, 2023, 1:58 PM
interface OtherContract {
function foo() external returns (uint256);
}

contract MyContract {
OtherContract otherContract = OtherContract(0x1234567890123456789012345678901234567890); // Replace with the actual address of the other contract

function myFunction() external {
uint256 result = otherContract.foo();
// Do something with the result
}
}
likek this?
Mar 17, 2023, 1:59 PM
anyone having gas issues on eth?
Mar 17, 2023, 3:05 PM
Yeah skem gas
Mar 17, 2023, 3:06 PM
i am getting all txs pending
Mar 17, 2023, 3:06 PM

© 2024 Draquery.com All rights reserved.