Fix StaticCallProxy comment and add sanity checks to TestStaticCallTarget
This commit is contained in:
parent
5dcf7919fc
commit
45aacf122f
@ -174,7 +174,7 @@ contract StaticCallProxy {
|
||||
// + 32 (assetData len)
|
||||
// + 4 (proxyId)
|
||||
// + 32 (callTarget)
|
||||
// + 32 (assetDataOffset)
|
||||
// + 32 (staticCallDataOffset)
|
||||
let expectedResultHash := calldataload(add(assetDataOffset, 100))
|
||||
|
||||
if sub(callResultHash, expectedResultHash) {
|
||||
|
@ -18,9 +18,13 @@
|
||||
|
||||
pragma solidity ^0.5.5;
|
||||
|
||||
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
|
||||
|
||||
|
||||
contract TestStaticCallTarget {
|
||||
|
||||
using LibBytes for bytes;
|
||||
|
||||
uint256 internal _state;
|
||||
|
||||
function updateState()
|
||||
@ -51,12 +55,17 @@ contract TestStaticCallTarget {
|
||||
function noInputFunction()
|
||||
external
|
||||
pure
|
||||
{}
|
||||
{
|
||||
assert(msg.data.length == 4 && msg.data.readBytes4(0) == bytes4(keccak256("noInputFunction()")));
|
||||
}
|
||||
|
||||
function dynamicInputFunction(bytes calldata a)
|
||||
external
|
||||
pure
|
||||
{}
|
||||
{
|
||||
bytes memory abiEncodedData = abi.encodeWithSignature("dynamicInputFunction(bytes)", a);
|
||||
assert(msg.data.equals(abiEncodedData));
|
||||
}
|
||||
|
||||
function returnComplexType(uint256 a, uint256 b)
|
||||
external
|
||||
|
Loading…
x
Reference in New Issue
Block a user