diff options
author | Fabio Berger <me@fabioberger.com> | 2018-08-27 22:28:57 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-08-27 22:28:57 +0800 |
commit | b8241c0f808518a3f727424cacb952cc9ce80c4c (patch) | |
tree | 309abba264ea3578cefdc8d7a4f53ef482ff26c9 /packages/contracts/src/2.0.0/test/TestStaticCallReceiver/TestStaticCallReceiver.sol | |
parent | fe7a8be98c32c6aed8548574e67e36962db732fb (diff) | |
parent | f4a4fefe422a5b2140d5bb394a7f06f842352c69 (diff) | |
download | dexon-sol-tools-b8241c0f808518a3f727424cacb952cc9ce80c4c.tar dexon-sol-tools-b8241c0f808518a3f727424cacb952cc9ce80c4c.tar.gz dexon-sol-tools-b8241c0f808518a3f727424cacb952cc9ce80c4c.tar.bz2 dexon-sol-tools-b8241c0f808518a3f727424cacb952cc9ce80c4c.tar.lz dexon-sol-tools-b8241c0f808518a3f727424cacb952cc9ce80c4c.tar.xz dexon-sol-tools-b8241c0f808518a3f727424cacb952cc9ce80c4c.tar.zst dexon-sol-tools-b8241c0f808518a3f727424cacb952cc9ce80c4c.zip |
Merge branch 'development' into dev-dropdown
* development: (120 commits)
Exit with non-error code at end of publishRelease
Publish
Updated CHANGELOGS
Fix prettier
Update changelog files for RC packages
Skip doc generation for local publishes since we test this in a separate CI test
Fix typo
Use absolute path
Run yarn a second time if the first fails
Try relative to root dir
Fix command
Move md files to lib folder during build
Change exit code to failure
Fix sra-spec `main` and `types` in package.json
Actual relative path
Try relative path
Issue #1025 BlockParam unroll
Fix command
Move md files to lib folder during build
Fix sra-spec `main` and `types` in package.json
...
Diffstat (limited to 'packages/contracts/src/2.0.0/test/TestStaticCallReceiver/TestStaticCallReceiver.sol')
-rw-r--r-- | packages/contracts/src/2.0.0/test/TestStaticCallReceiver/TestStaticCallReceiver.sol | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/packages/contracts/src/2.0.0/test/TestStaticCallReceiver/TestStaticCallReceiver.sol b/packages/contracts/src/2.0.0/test/TestStaticCallReceiver/TestStaticCallReceiver.sol new file mode 100644 index 000000000..41aab01c8 --- /dev/null +++ b/packages/contracts/src/2.0.0/test/TestStaticCallReceiver/TestStaticCallReceiver.sol @@ -0,0 +1,81 @@ +/* + + Copyright 2018 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +pragma solidity 0.4.24; + +import "../../tokens/ERC20Token/IERC20Token.sol"; + + +// solhint-disable no-unused-vars +contract TestStaticCallReceiver { + + uint256 internal state = 1; + + /// @dev Updates state and returns true. Intended to be used with `Validator` signature type. + /// @param hash Message hash that is signed. + /// @param signerAddress Address that should have signed the given hash. + /// @param signature Proof of signing. + /// @return Validity of order signature. + function isValidSignature( + bytes32 hash, + address signerAddress, + bytes signature + ) + external + returns (bool isValid) + { + updateState(); + return true; + } + + /// @dev Updates state and returns true. Intended to be used with `Wallet` signature type. + /// @param hash Message hash that is signed. + /// @param signature Proof of signing. + /// @return Validity of order signature. + function isValidSignature( + bytes32 hash, + bytes signature + ) + external + returns (bool isValid) + { + updateState(); + return true; + } + + /// @dev Approves an ERC20 token to spend tokens from this address. + /// @param token Address of ERC20 token. + /// @param spender Address that will spend tokens. + /// @param value Amount of tokens spender is approved to spend. + function approveERC20( + address token, + address spender, + uint256 value + ) + external + { + IERC20Token(token).approve(spender, value); + } + + /// @dev Increments state variable. + function updateState() + internal + { + state++; + } +} |