aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-05-25 03:29:45 +0800
committerGreg Hysen <greg.hysen@gmail.com>2018-06-08 06:36:18 +0800
commit9b82e2df58cfd7f4dc9954fa93167450919f457f (patch)
tree8b84f49b930ef7053dd34ad10894fc7f57c0e033 /packages/contracts/src
parent3d65341080177bdd436e7628a76e65774b947a38 (diff)
downloaddexon-0x-contracts-9b82e2df58cfd7f4dc9954fa93167450919f457f.tar.gz
dexon-0x-contracts-9b82e2df58cfd7f4dc9954fa93167450919f457f.tar.zst
dexon-0x-contracts-9b82e2df58cfd7f4dc9954fa93167450919f457f.zip
Foundation for TestLibAssetProxyDecoder
Diffstat (limited to 'packages/contracts/src')
-rw-r--r--packages/contracts/src/contracts/current/test/TestLibAssetProxyDecoder/TestLibAssetProxyDecoder.sol50
-rw-r--r--packages/contracts/src/utils/artifacts.ts2
-rw-r--r--packages/contracts/src/utils/types.ts1
3 files changed, 53 insertions, 0 deletions
diff --git a/packages/contracts/src/contracts/current/test/TestLibAssetProxyDecoder/TestLibAssetProxyDecoder.sol b/packages/contracts/src/contracts/current/test/TestLibAssetProxyDecoder/TestLibAssetProxyDecoder.sol
new file mode 100644
index 000000000..ac7cd63ab
--- /dev/null
+++ b/packages/contracts/src/contracts/current/test/TestLibAssetProxyDecoder/TestLibAssetProxyDecoder.sol
@@ -0,0 +1,50 @@
+/*
+
+ 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;
+pragma experimental ABIEncoderV2;
+
+import "../../utils/LibAssetProxyDecoder/LibAssetProxyDecoder.sol";
+
+contract TestLibAssetProxyDecoder is
+ LibAssetProxyDecoder
+{
+
+ /// @dev Decodes ERC721 Asset Proxy data
+ function publicDecodeERC20Data(bytes memory proxyData)
+ public
+ pure
+ returns (uint8, address)
+ {
+ return decodeERC20Data(proxyData);
+ }
+
+ /// @dev Decodes ERC721 Asset Proxy data
+ function publicDecodeERC721Data(bytes memory proxyData)
+ internal
+ pure
+ returns (
+ uint8,
+ address,
+ uint256,
+ bytes memory
+ )
+ {
+ return decodeERC721Data(proxyData);
+ }
+}
diff --git a/packages/contracts/src/utils/artifacts.ts b/packages/contracts/src/utils/artifacts.ts
index 1b47f1d41..44de43a95 100644
--- a/packages/contracts/src/utils/artifacts.ts
+++ b/packages/contracts/src/utils/artifacts.ts
@@ -10,6 +10,7 @@ import * as MixinAuthorizable from '../artifacts/MixinAuthorizable.json';
import * as MultiSigWallet from '../artifacts/MultiSigWallet.json';
import * as MultiSigWalletWithTimeLock from '../artifacts/MultiSigWalletWithTimeLock.json';
import * as TestAssetProxyDispatcher from '../artifacts/TestAssetProxyDispatcher.json';
+import * as TestLibAssetProxyDecoder from '../artifacts/TestLibAssetProxyDecoder.json';
import * as TestLibBytes from '../artifacts/TestLibBytes.json';
import * as TestLibMem from '../artifacts/TestLibMem.json';
import * as TestLibs from '../artifacts/TestLibs.json';
@@ -31,6 +32,7 @@ export const artifacts = {
MultiSigWallet: (MultiSigWallet as any) as ContractArtifact,
MultiSigWalletWithTimeLock: (MultiSigWalletWithTimeLock as any) as ContractArtifact,
TestAssetProxyDispatcher: (TestAssetProxyDispatcher as any) as ContractArtifact,
+ TestLibAssetProxyDecoder: (TestLibAssetProxyDecoder as any) as ContractArtifact,
TestLibBytes: (TestLibBytes as any) as ContractArtifact,
TestLibMem: (TestLibMem as any) as ContractArtifact,
TestLibs: (TestLibs as any) as ContractArtifact,
diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts
index cc6f00b95..70abb2643 100644
--- a/packages/contracts/src/utils/types.ts
+++ b/packages/contracts/src/utils/types.ts
@@ -90,6 +90,7 @@ export enum ContractName {
AccountLevels = 'AccountLevels',
EtherDelta = 'EtherDelta',
Arbitrage = 'Arbitrage',
+ TestLibAssetProxyDecoder = 'TestLibAssetProxyDecoder',
TestAssetProxyDispatcher = 'TestAssetProxyDispatcher',
TestLibMem = 'TestLibMem',
TestLibs = 'TestLibs',