4
votes
Accepted
What are the best online tools to easily make json rpc calls?
I've found the following 3 tools to be very useful for different use cases.
https://ethereum.github.io/execution-apis/api-documentation/
https://justsmartcontracts.dev/#/
https://www.quicknode.com/...
3
votes
Accepted
Using `call()` function returns false when trying to call function of a smart contract
It's because you need to use full name for types.
Just use uint256 instead of uint like this:
(bool success, bytes memory data) = helloContract.call(
abi.encodeWithSignature("set(uint256)&...
2
votes
Accepted
How to encrypt "InputData" to use my smart contract to make it unreadable
To obfuscate the input so that etherscan cannot decode it : YES.
To hide your contract's activity (ERC20 transfer): NO.
Although you can obfuscate and hide your input data, people can see your ...
2
votes
check if a DELEGATECALL has taken place during the transaction
I think you are right, considering that you cannot control or write the logic in A and B, it seems impossible.
However, if we consider only your example of 3 contracts, there could be an expensive way ...
2
votes
Accepted
Does the EVM revert if a call is attempted to an address that doesn't have code?
Calls to non-contract addresses (that is, EOAs or inactive accounts) always set the success flag to true and leave the return data field empty, so the right question isnt "Why lows level calls to ...
2
votes
Accepted
How does etherscan get such data?
I would like to add on to the previous answer for your specific case.
Since you are looking for Sales on opensea, You will use web3.eth.getTransaction() and loop through the logs array that is ...
2
votes
How does etherscan get such data?
Yes, you can.
There are a number of ways ERC20/ERC721 differ.
API’s/node providers allow filtering dependant on certain aspects of transaction’s data to deduce what happened in that transaction. This ...
2
votes
Accepted
How can I add consumers to a Chainlink VRF2 subscription with an external smart contract?
I have found the issue.
Looking at VRFCoordinatorV2.sol
The function addConsumer has a modifier called onlySubOwner here. Which is not explicitly outlined in the docs.
function addConsumer(uint64 ...
2
votes
Call smart contract method with ethers.js version 6
Look at this topic.
EthersJS Listening to events with NodeJS Strange Errors
It's a very similar issue and it turned out to be a bug from ethers.js 6. It is still beta and not official release, so it ...
2
votes
Accepted
How to encode arbitrary amount of parameters for encodeWithSignature without adding them to function definition?
Your problem is that you're using abi.encode with abi.encodeWithSignature, and encoding your address twice.
abi.encode takes your address and pads it with zeros to make it 32 bytes long since EVM ...
2
votes
Accepted
simulate a transaction considering another pending transaction
Ethers6 staticCall, same as Ethers5 callStatic method, sends the eth_call RPC request. The nonce parameter is not supported, so it has no effect. The mempool for eth_call is completely ignored, and by ...
2
votes
Using the Freeze functionality as a user in the BNB contract
I am not sure about about BNB provides with the UI, but I can tell you the raw method.
You can visit etherscan https://etherscan.io/address/0xB8c77482e45F1F44dE1745F52C74426C631bDD52#writeContract
...
1
vote
Accepted
calldata usage, difference between the method calling function with calldata
There is no difference; you are correct in assuming that this function was called in such a way: indeed calldata includes the function selector and data to be passed to that function.
1
vote
Accepted
Can you fetch the whole transaction history of specific contracts somewhere?
If you like to fetch specific contracts (or to an extent general account) address history, then you can use service such as Moralis.
They have Transaction API that can help you index transaction data ...
1
vote
Can you fetch the whole transaction history of specific contracts somewhere?
Yes, there are several services that allow you to query all transactions related to a specific smart contract. Etherscan, for example, provides a "View Contract" feature that allows you to ...
1
vote
Accepted
Retrive data from chainlink node
So let's say we have Contract CallingAPIConsumer and Contract APIConsumer.
You could have a function in CallingAPIConsumer that APIConsumer calls when fullfill() is executed, let's call it ...
1
vote
Best way to ignore the success status of a call?
With Foundry, there is a neat way to ignore Solidity compiler warnings, and that is to use the ignored_error_codes config option:
# ignore solc warnings for missing license and exceeded contract size
#...
1
vote
Does the EVM revert if a call is attempted to an address that doesn't have code?
A call, any call, has a caller, can have a value and can have some data. The value can be zero, the data can be empty, doesn't matter. By default as explained in the chosen answer, all calls are valid....
1
vote
Accepted
Do i need to fund my contracts with eth
Most likely not.
The user who issues the transaction pays for the gas cost of the entire transaction. This includes any inner "sub" transactions which call subsequent contracts from the ...
1
vote
Accepted
Why do I need a contract's code/abi to interact with it
You need to know the function signature or the function selector in order to encode the transaction data to be sent to that smart contract to interact with that specific function.
Remix needs to know ...
1
vote
Accepted
Difference between contract address and contract instance on ethernaut
The instance address refers to the contract that you are interacting with.
If you go to your console you can confirm this by typing:
contract.address
Which will match the instance address that is ...
1
vote
Accepted
Can send some data from smart contract to an EOA by Solidity call statement?
Yes you can, but it does not send anything, and the EOA address does not receive anything (because it doesn't have bytecode logic to receive)
contract Test {
bool public success;
bytes public ...
1
vote
Using `call()` function returns false when trying to call function of a smart contract
Adding to what OliverD said, this works in Remix:
pragma solidity 0.8.17;
contract Main {
event Response(bool successful, bytes data);
function testCallSetInt(uint v) external {
...
1
vote
Accepted
If a low-level call fails, are the state changes applied?
No, the state changes won't apply. Take the following code:
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.13;
contract Foo {
uint256 public counter;
function bumpCounter() ...
1
vote
Transaction consisting from transfers of 0 USDT
Carefull with this I think it is a new form of scamming that hackers are trying to do:
https://mirror.xyz/x-explore.eth/cL3d_CyNujXq8XY7ueP4omNXx_IY1EG5Dz0FD0vJ90M
1
vote
Accepted
Transaction consisting from transfers of 0 USDT
ERC20 tokens have a transfer function which allows you to send your own tokens, but also an approve and transferFrom function which allows you to approve a smart contract to take some of your tokens, ...
1
vote
What are the best online tools to easily make json rpc calls?
ETH JSON RPC
Not all RPC Endpoints will support all methods.
RPC by UI
We use this https://web3-rpc-debug.vercel.app -- is a fork of quicknodes tool (mentioned by Sahil Sen) but with updated code ...
1
vote
How to initialize a smart contract using Remix?
your initialize function has a modifier initializer which i believe you are importing from here.
The modifier requires you to call the initialize function while deploying the contract itself, you cant ...
1
vote
How call() function works in solidity?
I read that we use call() only when we don't know the ABI of the called contract and we don't know its source code
This isnt true and i wonder when you read that. As you already figured out, to call ...
1
vote
What is a function signature and function selector in solidity (and EVM languages)?
@patrick-collins answer is useful, but I thought I'd add code to calculate the selector in TypeScript/ethers/hardhat:
/**
* Returns an Ethereum function selector given the function signature
* @...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
contract-invocation × 1175contract-development × 362
solidity × 357
web3js × 186
contract-design × 185
transactions × 120
contract-deployment × 116
go-ethereum × 92
contract-debugging × 65
remix × 55
gas × 51
truffle × 42
tokens × 39
abi × 35
evm × 34
metamask × 33
javascript × 33
ethers.js × 31
blockchain × 30
addresses × 30
events × 29
erc-20 × 28
nodejs × 28
ether × 27
web3.py × 22