I Would like to know if there is a solidity equivalent to this web3:
web3.eth.abi.decodeParameter()
I'm currently looking at something like Seriality, but wondering if there was a supported native solidity implementation of the above. Including inline assembly.
My code looks something like: Web3 part:
var _data = await ABI.encode("120000000000000000000", user2, OCcontract1.address, "120000000000000000000", OCcontract2);
await swap(_data);
Solidity part:
Swap(_data){
uint256 _amount;
address _receiver;
address _tokenLeadContract;
uint256 _expectedAmount;
address _expectedSC;
(_amount, _receiver, _tokenLeadContract, _expectedAmount, _expectedSC) = decode(_data);
}
_checkOnOCTReceived()
which usesonER721Received()
to determine whether we should call the function above, in order to comply with the stndard to the greatest extent possible we would like to usebytes memory _data
, there is no real reason beyond this, but it would certainly look cleaner and be potentially more efficient.