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
0
votes
1answer
11 views

How to configure `truffle test` to fork the main/rinkeby chain as its local chain?

The smart contract I want to unit test instantiates IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D). Obviously this contract does not exist on the local chain that is spawned by truffle ...
0
votes
1answer
18 views

How to use web3 to interact with contract deployed on private network [closed]

I have created a small private network using geth on my local machine and deployed a smart contract on this local private network using remix IDE. I want to be able to connect my nodejs backend to ...
0
votes
0answers
7 views

Multplier Finance How to get the available reserves on mainnet and testnet

I am trying to conduct tests involving flash loans from multiplier.finance on the BSC testnet chain. I am trying to find out what the tokens with available reserves on the testnet lending pool. ...
0
votes
0answers
6 views

how to get transaction calls depth, it's to get contract call which contract

how can i get transaction call depth? just like this website shows https://explorer.bitquery.io/ethereum/tx/0x67919e359276ecc7de83e50220b6d0e9d0292711f2a8cd6245f8c297cc595185/calls
0
votes
1answer
7 views

Do I need to call the functions in my smart contract?

Lets say I have a contract including the following: uint256 public _burnFee = 3; function setBurnFeePercent(uint256 burnFee) external onlyOwner { _burnFee = burnFee; } I compile and deploy ...
0
votes
0answers
19 views

Is there anyway to extract all Ether Transaction within a Contract call by Web3?

Extracting Token Transfer is trivial which can be done by lookup all logs emitted from the Transaction with Event Signature and Topics. By these assumptions : No ABI is known for the contract No ...
0
votes
1answer
8 views

How does providing gas for a function-in-function call in a contract work?

Looking at this article about contract interactions, I saw this line of code: someAddress.call.gas(1000000).value(1 ether)("register", "MyName"); With the explanation: It’s also ...
0
votes
0answers
4 views

Can/will a Serenity smart contract be able to cover gas fees?

Vitalik Buterin first expressed here the concept that Serenity contracts would cover a contract-pays instead of a user-pays option. There is also this relevant Improvement Proposal, but I have failed ...
1
vote
2answers
44 views

How is OpenSea able to allow sellers to list NFTs for free, and without gas fees?

Besides the usual 2.5% commission, NFTs minted on OpenSea are known to be free to list with a price since OpenSea does not take custody of the NFT anytime during the sale process. Does it though as ...
0
votes
0answers
9 views

calling a method in smart contract using sendRawTransaction and getting result [duplicate]

first of all, i know that this has been asked before or there are similar questions to before, just like this one How to call my contract's function using sendTransaction however, I am confuse on ...
0
votes
1answer
61 views

How to convert WETH back to ETH (solidity)

I am trying to convert back WETH into ETH (actually BNB on BSC). I am doing the following: function allToBNB() public{ WETH.transfer(address(this), WETH.balanceOf(address(this))); }` ...
0
votes
0answers
9 views

Is there a way to charge gas fees to a smart contract that you use to call another smart contract?

If user account A makes a call to smart contract B that then makes a call to smart contract C, is it at all possible to have smart contract B cover the gas fees of this transaction? Essentially what I ...
0
votes
0answers
19 views

How to create a Nested Looping of an array of addresses and addresses' balances

I am writing a Presale contract for a particular number of addresses. it is only the owner of these addresses that can participate in the presale, however, I get fetched these addresses on-chain then ...
1
vote
1answer
22 views

Accidentally deployed two identical contracts on blockchain. How can I pick the one I wish to interact with?

I deployed two identical contracts on the same blockchain. contract V1 address:0x48A2a37fF1Cff6eB1984aCA7fCA4cAa25B1C9287 contract V2 address:0xdfaDE9c110eBD5C00243Ca0b3AdCf5B73A8f0e42 However I ...
5
votes
1answer
224 views

Proxy contract to avoid sniping bot

I am working on a trading bot with ethers.js and I would love if someone could elaborate on the following topic. Many sniping bots try to buy as fast as liquidity is added to the pool. This can be ...
0
votes
1answer
32 views

Obtain transaction hash from event (ethersjs)

My goal is to detect a contract invocation as fast as humanly possible. To do this I am processing all the pending transactions I have access to (via provider.on("pending", async (tx) => {...
1
vote
0answers
26 views

How to design a smart contract that allows people to trade NFTs

Instead of smart contracts that people deposit ETH into as offers to buy NFTs (ETH for NFT), how can a smart contract be designed so that two counterparties can deposit NFTs into the smart contract in ...
1
vote
2answers
260 views

PancakeSwap V2 swapExactTokensForTokens not working, getting stuck

I am unable to get this working with ethers.js. I know there are many similar questions for this specific topic, but none of the answers seem to work for me. My attempt is mostly based on Noob ...
0
votes
0answers
27 views

Recreate transaction log in solidity code

I have this log and i want to code a solidity contract/function that would do the same. What i understand reading this transaction is that WBNB contract (0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c) is ...
0
votes
0answers
9 views

MyEtherWallet interact with contract : generate input from ABI

Do you know some code to generate a contract interaction from ABI like there is on MyEtherWallet ?
0
votes
1answer
12 views

How to calculate this function for both Ethereum networks mainnet and ropsten getBlockTimestamp().add(delay)?

I have a question: How to calculate this function for both Ethereum networks mainnet and ropsten getBlockTimestamp().add(delay)? I installed web3.eth and tried web3.eth.getBlockTimestamp().add(delay) ...
1
vote
1answer
122 views

How does Uniswap allow a user to specify which tokens the user wants to swap in this low level function?

I'm looking at the function swap that allows a user to swap token0 for token1 from Uniswaps UniswapV2Pair contract - https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2Pair.sol. ...
1
vote
1answer
131 views

how to get the reserves of all coin pairs at once on pancakeSwap

I am trying to query the pancakeSwap token pair contract for the reserves, and since I am trying to get it for 10000 tokens at a single time. My current solution is to basically loop over the 10000 ...
0
votes
0answers
40 views

Calling the fuction GetEthToTokenInputPrice

Please help since I'm getting furious over this problem. I deployed a contract to the ropsten network, and am trying to call a function getEthToTokenInputPrice to see if it worked through solidity. I ...
1
vote
0answers
160 views

How to find the reserves of each coin pair on the pancakeswap coinPair smart contract

I am trying to calculate the reserves of each coin in the pool of a coin pair at a given time. using the https://api.pancakeswap.info/api/v2/pairs API, I can't seem to find that value. the API does ...
0
votes
0answers
17 views

passing left for uint256

I'm trying to use this method: function test(uint amount) public { address(0xf5eA38B6b9644224dA1aECbC1219e8543c0689b2).call(abi.encodeWithSignature("deposit(uint)",amount)); } ...
3
votes
3answers
3k views

where can i find the addresses of the pancakeswap coin pairs smart contracts

where can I find the smart contract address of all (or the major) coin pairs of the pancakeswap AMM. I can't find it anywhere and searching on google yields random articles.
0
votes
1answer
19 views

Calling smart contracts with value using web3js and galanche

I'm fairly new to Ethereum smart contracts, so this might be a stupid question, but I need someone to help me out. I've set up Galanche on my machine (MacOS 11) and written a very simple currency ...
0
votes
1answer
16 views

Sending ether to a contract without data throws an error

I'm trying to deploy a smart contract that allows users to buy tokens that can be used to pay fees on its platform. In case someone is going to send ETH directly to the contract address without ...
1
vote
1answer
230 views

getting reserve data of a pair of tokens in pancakeswap pools

I am trying to find the current and past reserves for a coin pair of a certain pool from the pancakeswap smart contract. I can't seem to find any smart contract that can return that. (can't get find ...
0
votes
1answer
15 views

Smart contracts calling each other, costs and atomicity doubt

According to what I know, If you invoke function F on Contract C, you pay the gas fees related to F's operations and if for some reason something goes wrong, all state changes performed by F until ...
0
votes
0answers
19 views

approval ERC20 standard front-running

In the following article Link, we read: Token owner just needs to make sure that first transaction actually changed allowance from N to 0, i.e. that the spender didn't manage to transfer some of N ...
0
votes
0answers
18 views

how to get the list of tokens that are specific to my requirements

Some of the tokens, have the weird approve methods. Meaning that they tried to mitigate front-running. https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/edit I am trying ...
1
vote
0answers
29 views

Gas limit too low when using transaction data field

I am using web3.js to send a transaction. This is the code that I have currently: async function sendTx(tran, ethAddress, privateKey, value=0) { var tr = { chainId: await web3.eth....
2
votes
0answers
122 views

How can I call a library method from a contract?

I'm currently looking at this contract (https://bscscan.com/address/0x05ff2b0db69458a0750badebc4f9e13add608c7f#code) (yes, I'm aware it's bsc and not eth, but functionally, they're the same). Inside ...
1
vote
1answer
46 views

Get data from smart contract interaction before or whitout sending transaction

I have a contract with an ABI and I'm currently interacting with it on ropsten network. I have this function that ask metamask to sign transaction, it's a smart contract interaction and I transfer a ...
0
votes
0answers
12 views

How to get smart contract assertion message thorugh web3.js? [duplicate]

I revert a transaction in my smart contract when a specific condition is met. For instance: function doMoneyLaundering(uint256 millionsOfDollars) public { ... require(...
0
votes
3answers
48 views

Can I interact with an ethereum contract through C/C++?

Assuming I have a device that receives sensor data in C, and I want to make calls to an Ethereum smart contract directly through it, is there a way to use C/C++ for that communication? Something ...
0
votes
0answers
16 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
23 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
59 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
50 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
635 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
43 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
14 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
21 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
15 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
25 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
13 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 ...

1
2 3 4 5
20