Questions tagged [contract-invocation]

Questions regarding the act of calling or interacting with (a.k.a. invoking) a contract on the Ethereum blockchain by a user or another contract on the blockchain. Includes both local invocation by call and global invocation by transaction.

Filter by
Sorted by
Tagged with
1
vote
0answers
13 views

JIT events on etherum

I would like to write a contract, that fetches a data from oracle in a specific point of time (or later) Is there any option to pop up an event in some point in the future in Ethereum contract? The ...
1
vote
1answer
13 views

How to get tokens from a contracts 0x0 address?

I was having a deep dive through an address I found interesting and noticed that all his tokens always came from a contracts 0x0 address. How is this done? I assume this is how smart contracts work ...
0
votes
1answer
12 views

Getting current user balance of an aToken for a specific asset in AAVE v2 protocol

As AAVE protocol V2 documentation says: aTokens are interest-bearing tokens that are minted and burned upon deposit and withdraw. The aTokens' value is pegged to the value of the corresponding ...
0
votes
1answer
33 views

Interact with a contract function using Web3.js

I finished testing my smart contract functionality with "unlocked accounts" (which don't require complex signing) on a local dev blockchain, but now I would like to deploy on MAINNET and use ...
1
vote
1answer
31 views

i stupidily wrapped my ether to weth from metamask using uniswap,

I stupidly wrapped my ether to WETH from MetaMask using Uniswap. I then used https://relay.radar.tech/ to unwrap it but its taking so long. Here is the transaction hash ...
0
votes
1answer
21 views

How would you create a smart contract that allows for a commission?

Let's say you were building a marketplace and you wanted to take some type of commission for allowing a user to sell a thing on your marketplace....how exactly does that work? Is there some type of ...
0
votes
0answers
12 views

How can a contract interact with other chains?

Reading the Waifusion postmortem article this caught my eye: At the same time, we were made aware of multiple parties that were going to fork us as soon as we went live with a sale on BSC. This has ...
1
vote
1answer
17 views

Internal transactions totaling 100+ Ether flowing into a wallet

When you look at the wallet address below, it has a balance over 100 ETH but there are no inflows in the etherscan ledger to show where those funds came from https://etherscan.io/address/...
1
vote
1answer
11 views

Options for executing an arbitrary function from my wallet

What are my options if I want to call an arbitrary function at an arbitrary address, from my wallet (Metamask)? To be more precise, I want to be able to call a function from a web wallet, when I have ...
1
vote
2answers
21 views

How to send Ethereum to smart contract address without using keyword “payable”?

I have tried to send Ethereum from my wallet to the smart contract address by using the below code: pragma solidity >=0.6.10; contract NoUsePayable { function getBalance() public view returns (...
0
votes
1answer
12 views

How this snippet is linking contracts? How each contract finds the other

I'm trying to understand how can two contracts be deployed and interact with each other, given that I don't have their addresses before deployment. I ended in this question and I don't understand the ...
0
votes
0answers
16 views

How does time work in a smart contract? [duplicate]

I have seen this question and answers but they do not answer my question. Let say I want to create a smart contract that releases ether when a certain time reaches. How does the blockchain know that ...
0
votes
1answer
24 views

If Uniswap's domain goes down, how can we remove our tokens from a Liquidity pool manually without a front end interface?

Let's assume Uniswap's domain and front end interface is taken down. How can I as a user manually remove my tokens from a liquidity pool? What do I need and todo?
1
vote
1answer
21 views

How can I invoke an approve() function call from the user and not the contract?

I am working on a basic staking platform for practice. I understand that the user of the platform has to call the approve() function and pass the contract into it in order for the contract to use the ...
0
votes
1answer
26 views

How to read uniswap TX input to find out what swap was made?

Look at this tx : https://etherscan.io/tx/0x9854f2249f86802cb0edcff0aa6747de6c49d89b0ba0dc2038b00372b949356b it says 0.3RTH send to uniswap and 6,447.815435380239985848 L3P got from uniswap. However ...
0
votes
1answer
18 views

Opinions on setting variables via constructor vs setter function?

I haven't found any opinions about this online so far, so I'm soliciting opinions here. What are the pros/cons of setting variables in the constructor of a Solidity contract versus having no ...
1
vote
0answers
14 views

How to forward returned bytes from calls executed with assembly?

I would like to make an external call with assembly, but am having trouble retrieving the return data as "bytes". The code below currently returns only 32 bytes, which just shows the length ...
1
vote
1answer
20 views

Why is the math code causing transactions to fail

Ok so This is my first time working on solidity contracts and I'm at a loss how to debug this code. This code fails: function claimReturns(address claimant) private { uint otherTotals = ...
0
votes
0answers
46 views

(Error): Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract

I am trying to interact with a smart contract I deployed to a testnet with my react app locally, but for some reason I keep getting this error. I am able to connect metamask to the dapp, but when I ...
3
votes
1answer
45 views

how does Ethereum singing request work?

What's the need so that some dapp websites ask you to sign messages via metamask the first time you get on their website ? as I read, it's so that they make sure you get authenticated. So you sign the ...
0
votes
0answers
33 views

List of contracts bound to an address

Is it possible the view the list of all contracts an Ethereum address is bound to? scenarios: John deposited funds in many DEXs but can't remember which ones. John would like to see if his wallet has ...
0
votes
0answers
19 views

Retrieved Uniswap token price from smart contract is inaccurate compared to the one displayed on Uniswap interface

I'm trying to create a bot using JavaScript that interacts with Uniswap's smart contracts. I have been using UniswapV1's factory and exchange contracts, and I was using the getEthToTokenInputPrice ...
1
vote
1answer
38 views

Without a block explorer API, can I programmatically determine if an address has a contract deployed at it (eg using Web3 or call to a node)?

Given an address, from a web application I'm attempting to determine if there's a contract deployed at the address. There are some ways to do this with etherscan or other block explorer APIs, but I'm ...
0
votes
0answers
40 views

Ethereum contract chi gas token always uses 0 tokens

I'm trying to use chi gastoken in my contract to pay for gas, i use this modifier: constructor(address _chi, address payable _owner) public { chi = IFreeFromUpTo(_chi); //...
2
votes
1answer
34 views

Cancelled Transaction in MetaMask USDC leads to loss of funds

I had attempted to transfer 992 USDC from MetaMask to a Ledger Account but had decided to cancel the transaction. On cancelling, MetaMask reports that the cancellation succeeded, but my MetaMask USDC ...
0
votes
1answer
68 views

Is ownership of tokenized real assets through NFT upheld by law?

Let's say you've tokenized your house as a non-fungible token (NFT) on the Ethereum blockchain. if an NFT simply represents ownership of a tokenized asset, what actors or agencies currently will ...
0
votes
0answers
39 views

Killing a smart contract and recovering funds inside

I’m trying to kill a contract that I set up and own. I understand (and hope) that killing a contract will send any ETH inside the contract to the owning account. The method I use are either MEW or ...
0
votes
1answer
33 views

How to type-cast contract type to address type?

Contracts can be explicitly converted to and from the address type. In solidity docs, it's mentioned that the contracts can be converted into an address type. But when I try to do so the compiler ...
0
votes
1answer
19 views

Find a Function Call Across All Contract Transactions

Is it possible to search for a particular function call across all transactions of a smart contract? I'm doing due diligence on 1inch's smart contract in order to see if renounceOwnership was called ...
0
votes
0answers
23 views

Different ways of exchanging tokens

I am conducting a study on transaction behaviour and dynamics on the Ethereum blockchain. Currently, I am analysing the token transfers of different user groups. After leveraging Google Big Query and ...
1
vote
0answers
19 views

ethereum makes extra space for no reason in memory

pragma solidity ^0.6.8; contract C { function test3(uint f) external returns(uint256[3] memory) { uint256[3] memory arr; arr[0] = 1; arr[1] = 2; arr[2] = 3; ...
1
vote
1answer
39 views

what does call stack of 1024 mean in solidity?

Assumption 1: If we create a local variable, call stack increases by 1, because we put this new local variable on the stack. if I create another local variable, it again increases by 1. So, with this ...
0
votes
0answers
22 views

ERC165 - why is it a good idea?

I am trying to understand ERC165. Let's say we have a contract - contractB and we have a contract contractA. I think, what this ERC says is that before contractA can call the contractB's function, it ...
0
votes
1answer
37 views

How to combine multiple single smart contract actions into a single transaction

Is it possible to batch multiple smart contract actions / function calls into a single transaction? For example, I have n NFTs that I would like to call two functions on each. If I interact through ...
0
votes
1answer
37 views

Is there any way to find out what exchange a ETH wallet was created?

I added a ETH wallet address to Genesis Mining back in 2017 for a 2 year contract. After the contract was finished it still took them a year to add the ETH to said Wallet. (long story but I did not ...
1
vote
0answers
15 views

Is there any way to burn an EOA?

I have a non-upgradeable contract that gives an EOA the non-revokable permission to pause certain actions in the contract. I inherited from OpenZeppelin's PausableRole.sol but I removed the "...
0
votes
0answers
26 views

Are there any simple, simulated smart contracts to try out?

The barriers to buy, sell and trade cryptocurrencies are fairly low. Anyone can try it now. But very few of the same people can say that they've ever tried to enter into a smart contract. Are there ...
1
vote
0answers
28 views

why does it copy into memory?

Let's say I have the following.. contract D { function again(uint256[3] memory bla) external returns(uint) { return bla[0]; } } contract A { function test(D f, ...
1
vote
0answers
11 views

why would I need to use `memory` in front-of parameter?

Let's say I have the following contract. contract D { function again(uint256[] memory bla) public returns(uint) { return bla[0]; } } contract A { function test(...
0
votes
1answer
30 views

how does gas get taken from the account?

Let's say we call the function: function nice(uint a) public returns(uint256){ k = 100; z = 100; f = 100; require(a == 5); ...
0
votes
0answers
17 views

why can I specify `memory` if function is internal?

In the latest compiler versions, we can do the following: function balanceOf(uint[5] memory data) external view returns (uint256) { Until some version of the compiler, i couldn't specify memory, ...
0
votes
0answers
22 views

how does calldata not work in this case?

pragma solidity ^0.7.4; contract D { function test2(uint[1] calldata good) external { uint c = good[0]; } } This code is perfectly valid. What I do is deploy ...
0
votes
0answers
11 views

what's the difference between assembly part and opcode part in remix?

In the remix, there's compilations details button. When you click, one can see Bytecode and also assembly parts. Bytecode is an object which has object key and opcodes key in it. As far as I can see, ...
0
votes
0answers
19 views

ethereum solidity - gas cost wrong

This is bugging me so much time and spent hours and hours on this, I'd really appreciate your help so much.... // this costs 21394 function test2() external { } // this costs 21507 function ...
0
votes
1answer
33 views

How can I call a function that performs a transfer in web3?

I would like to call a function in smart contract using web3. In the function, I perform few transactions. The first method that I tried is await myContract.methods.endAuction().call();. This reverted ...
0
votes
0answers
15 views

Smart contract for selling log-in subscription service

If not ethereum, which smart contract token would be best suited for fulfilling the sale of a month-long anonaymous subscription for cryptocurrency that enables the buyer to have their own username ...
1
vote
1answer
26 views

Ethereum storage - how does this cost happen?

contract A { uint x = 10; function test2() public { x = 0; } } I can see that: Transaction cost is 13204 Execution cost is 5136 How can this be ? I ...
1
vote
0answers
58 views

Ethereum cost - how does it work in memory

This is really bugging me and doesn't seem any article that can help at all. wiki says further the gas costs for using memory: The fee for expanding memory is determined via a subtract-the-integrals ...
1
vote
1answer
21 views

what is expansion cost?

I am trying to understand what expansion cost is. We can see that there's this formula to count the memory cost - Now, It's also said that this formula doesn't include the expansion cost. Can anyone ...
3
votes
2answers
82 views

how can library change state?

I have Very Interesting cases about Libraries. CASE 1: I read the following in the official solidity docs: Library functions can only be called directly (i.e. without the use of DELEGATECALL) if they ...

1
2 3 4 5
19