Questions tagged [external-function]
The external-function tag has no usage guidance.
15 questions
1
vote
0
answers
44
views
Calling Mint And Change Balance From Another Smart Contract
My Project is about a Token in which the Holder can disable their token at the Old Address and Receive a New Minted token.
It uses 2 different contacts. I put the functions in the BBB contract and ...
1
vote
1
answer
48
views
Do interface functions revert on failure?
I was wondering if interface functions automatically revert the whole transaction on failure or not?
Let's say I want to call the sync() function of a liquidityPair, which usually returns no boolean:
...
0
votes
0
answers
52
views
calling function of a smart contract through another smart contract
i have 2 smart contracts:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "./../node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract HNFT is ERC721 {
...
1
vote
0
answers
129
views
How can I run a truly serverless function on web3 type infrastructure?
I want to run a serverless function that is actually serverless. Serverless functions platforms like AWS Lambda, Google Cloud Functions, etc... are not actually serverless. A centralized VM owned by ...
0
votes
0
answers
61
views
Transaction reverts when i try to call a specific function of another smart contract
i'm facing a weird issue and i can't understand why it's happening after quadraple checking everything,
i have a token which has USDT internal liquidity,
i also have matrix contract which is in charge ...
0
votes
0
answers
232
views
Unable to call contract function because Metamask doesn't pop up though it's connected to Remix
I've been having this issue for a while. Whenever I try calling a function or deploy a contract using Remix, the Metamask doesn't pop-up, even though if Metamask is connected to Remix. The only thing ...
1
vote
2
answers
60
views
Why is the function external in the following solidity script?
Came across this script teaching people how to use library, but I don't understand why the function testFind should be external in the following script. The definition of external function is : ...
1
vote
0
answers
26
views
How to build & sign a raw transaction calling a function on an 3r party already deployed contract [duplicate]
My goal is to sign a raw transaction, then broadcast it through the Ftmscan/Etherscan API.
I don't want to deal with web3 providers like Infura/Alchemy, if possible.
Just write the raw transaction, ...
0
votes
1
answer
32
views
Not being able to get interface to work
I have been trying to get a basic interface working on remix, but havent managed to. Did read a few examples but I must still be making some mistake.
Trying to interact with this contract:
// SPDX-...
1
vote
0
answers
287
views
Decode transaction output
I have an external function that modifies the state and returns a value:
function test(string memory testValue) external returns (string memory) {
state = string.concat("test",...
1
vote
1
answer
93
views
Are external contract to contract calls input data also stored in the calldata space?
I am aware that calldata is a read-only byte-addressable space. When calling a contract from an EOA it contains the function signature of the call as well as the input args. However when a contract ...
0
votes
0
answers
34
views
Is it gas efficient to call another contract's external function in a loop?
I am trying to create a staking protocols where rewards and staking are separate. But there are multiple tokens that get rewarded and I need to update each of them in a loop. Now, my question is how ...
0
votes
2
answers
157
views
What if a dynamic call at the end of a function uses all the remaining gas of the caller?
Suppose we have a contact like this:
contract x {
function y() external
{
// do some magic!
if (some_condition) {
another_contract_address.call(abi.encodeWithSignature("...
3
votes
1
answer
2k
views
Can external solidity functions get called within the same contract dynamically?
Assume we have the following solidity contract:
contract khiar {
function mooz(uint size) external {
// do something with mooz!
}
function bademjoon(uint size) external {
/...
327
votes
9
answers
118k
views
`external` vs `public` best practices
Apart from the public modifier Ethereum introduces the external one. Both may be called outside of the contract and inside (the later one by this.f() pattern). Moreover, according to the docs:
...