Questions tagged [abi.encodewithsignature]
The abi.encodewithsignature tag has no usage guidance.
15
questions
0
votes
0
answers
23
views
how to get a function's signature that have a structre as parametter
function createClone(
uint256 dbId,
launchpadLib.IDOInfo memory _idoInfo,
launchpadLib.IDOInfoTwo memory _IDOInfoTwo
) external{}
I have this funtion how can i make signature of this function with ...
1
vote
1
answer
25
views
How can I execute a call from a contract using another contract?
I own a contract (contract A), which in turn, when deployed, created a secondary contract (Contract B).
I have funds trapped in contract B, contract B, has a function that allows its owner to withdraw ...
1
vote
2
answers
565
views
'Address: low-level call failed'
I'm practicing 'Damn Vulnerable Defi #3.Truster'. I created Attacker contract and tested truster.challenge.js. But I got an 'Address: low-level call failed' error. Is this error related to ...
1
vote
1
answer
334
views
Encoding a bytes array with function signature: "TypeError: This type cannot be encoded."
I have a function in a smart contract I'm trying to call with call.
function doStuff(bytes[] calldata data) external payable {
To call it, I'm running:
bytes[] memory dataArray = new bytes[](1);
(...
1
vote
2
answers
105
views
Call fails when I send 2 params to other contract with abi?
I can send 1 parameter to Contract A (otherContract) and it works well. But when I send 2 parameters, it fails. What do I do wrong?
Contract A:
function sumTwoParams (uint256 _num1, uint256 _num2) ...
1
vote
1
answer
176
views
Able to call swap function with interface, but not with .call(
SwapByInterface works, swapByCall doesn't. Edit: have changed code to require success of internal call, previously both calls succeeding because errors not bubbling up, made the question more ...
0
votes
1
answer
140
views
Signature from array of tokenId's isn't verifying
The domain message is:
struct Offer{
address from;
address to;
uint256 nonce;
uint256[] tokenIds;
uint256 duration;
}
bytes32 constant ...
1
vote
1
answer
985
views
What is the difference between encodeWithSelector and encode?
I've been messing around with the abi.encode... functions and I think I have a good grasp of the differences, except abi.encode and abi.encodeWithSelector. Because, they give similar but slightly ...
0
votes
1
answer
653
views
How do I pass a struct as an argument in delegatecall to a proxy library?
I am trying to call the buyAssetsForEth function in the OpenSeaMarketV2 library using delegatecall as follows:
pragma solidity 0.8.4;
contract Owned {
address public owner;
constructor(...
0
votes
0
answers
305
views
Revert transaction payable error with abi.encodeWithSignature
I have two contracts:
Validate.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
contract Validate {
function validate(address _verifier, bytes memory _validityData) public view {
...
0
votes
1
answer
2k
views
Encode function data with value
I have Contract A:
import "@openzeppelin/contracts/utils/Address.sol";
contract A {
using Address for address payable;
function proxyCallWithValue(address payable target, bytes memory ...
0
votes
1
answer
744
views
solidity call(abi.encodeWithSignature) not working
I have problems using the "address.call(abi.encodeWithSignature(....))" method.
Below is the code I am testing in Remix:
pragma solidity >=0.7.0 <0.9.0;
library lib {
event ...
3
votes
0
answers
998
views
abi.encodeWithSignature and abi.encode have inconsistent results with dynamic arrays
pragma solidity 0.8.0;
function isMemberOfArrayEncodedTest(address member, address [] memory memberArray) public returns (string memory){
bytes4 sig = bytes4(keccak256("isMemberOfArray(...
1
vote
1
answer
2k
views
Encode function signature with callback function as parameter in Solidity
I would like to use low-level call to make calls to my contract. The function takes a callback function as an argument and I am not able to encode it.
This is my code:
contract B{
event Foo();
.....
1
vote
1
answer
320
views
setting value using address.call() doesn't works
I am trying to run a setter function (testCallBar) in Caller contract which should run setVal() of Receiver contract using call method. But it does not works. testCallFoo() works as expected but ...