Questions tagged [external-function]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
28 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 ...
Suka Kasu's user avatar
1 vote
1 answer
42 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: ...
Andy's user avatar
  • 185
0 votes
0 answers
49 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 { ...
Andrea Lorenzetti's user avatar
1 vote
0 answers
98 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 ...
ChristianOConnor's user avatar
0 votes
0 answers
59 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 ...
S Arv's user avatar
  • 11
0 votes
0 answers
164 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 ...
caiosa's user avatar
  • 23
1 vote
2 answers
50 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 : ...
Simon Zhao's user avatar
1 vote
0 answers
24 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, ...
Ico's user avatar
  • 11
0 votes
1 answer
30 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-...
Msantamaria's user avatar
1 vote
0 answers
255 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",...
Alex Bean's user avatar
  • 201
1 vote
1 answer
53 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 ...
FreddyC's user avatar
  • 301
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 ...
Mr.SsS's user avatar
  • 415
0 votes
2 answers
134 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("...
Ehsan Khodarahmi's user avatar
2 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 { /...
Ehsan Khodarahmi's user avatar
318 votes
9 answers
111k 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: ...
Jakub Wojciechowski's user avatar