Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Fix StaticCallProxy comment and add sanity checks to TestStaticCallTa…
Browse files Browse the repository at this point in the history
…rget
  • Loading branch information
abandeali1 committed Jun 17, 2019
1 parent 85e441a commit e31c98d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contracts/asset-proxy/contracts/src/StaticCallProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
13 changes: 11 additions & 2 deletions contracts/asset-proxy/contracts/test/TestStaticCallTarget.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e31c98d

Please sign in to comment.