Skip to main content

Questions tagged [abi.encodewithsignature]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
21 views

Abi Encode with Signature - String memory as parameter to function

I'm trying to do abi.encodeWithSignature( "mint(address, string **memory**)", receiverAddress, tokenURI ) The function definition ...
MAYANK CHHIPA's user avatar
0 votes
1 answer
29 views

How to abi.encodeWithSignature the function which contains structure as the parameter in solidity?

I want to call Uniswap's collect function which is in NonFungiblePositionManager contract using delegatecall. But the collect function takes the structure as the parameter. Here is the collect ...
Aviroxi's user avatar
1 vote
1 answer
65 views

Chainlink CCIP publishing message (encoded function call) to bring USDC from another chain is getting reverted with "Ready for manual execution" error

The encoded function call corresponding to bringUsdcFromAnotherChain when called using publishMessageToBringUsdcFromAnotherChain is getting reverted with "Ready for manual execution" error ...
SYED ASAD KAZMI's user avatar
1 vote
1 answer
25 views

abi.decode() does not accept "address payable" as type

function myStatic() public returns (uint256[] memory, address payable[] memory, bytes32, string memory) { bytes memory encodedResult; bool success; (success, encodedResult) = address(...
user130657's user avatar
1 vote
1 answer
33 views

Low-level function call to other contract is causing revert with correct function selector

I have 2 contracts, FloorInfo and Elevator. I want to call the goTo(uint) in the Elevator contract from the FloorInfo contract using a low-level call, this happens in the go() function inside the ...
nostonksafrica's user avatar
0 votes
0 answers
35 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 ...
VIKASH VASHISHAT's user avatar
1 vote
1 answer
47 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 ...
Leandro Loures's user avatar
1 vote
2 answers
839 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 ...
Shift_that's user avatar
1 vote
1 answer
417 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); (...
Patrick Collins's user avatar
1 vote
2 answers
109 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) ...
Bora Özenbirkan's user avatar
1 vote
1 answer
217 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 ...
Maxwell Singer's user avatar
0 votes
1 answer
176 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 ...
Владимир Владимирович's user avatar
1 vote
1 answer
1k 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 ...
Pedro's user avatar
  • 55
0 votes
1 answer
794 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(...
Mr.Snow's user avatar
  • 25
0 votes
0 answers
320 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 { ...
ML_DL_RL's user avatar
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 ...
forhas's user avatar
  • 785
0 votes
1 answer
763 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 ...
Alberto Molina's user avatar
3 votes
0 answers
1k 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(...
John Sterlacci's user avatar
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(); .....
Merve Sahin's user avatar
1 vote
1 answer
337 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 ...
Abhishek Sinha's user avatar