Compare commits
107 Commits
@0x/contra
...
@0x/contra
Author | SHA1 | Date | |
---|---|---|---|
|
2d3fe02cd7 | ||
|
7d61cb6bac | ||
|
a804433a7a | ||
|
11082320c2 | ||
|
9f9797b123 | ||
|
05d34616b7 | ||
|
c7f474ada1 | ||
|
b4b34e4890 | ||
|
eec016380d | ||
|
dcab272be0 | ||
|
418d033a5c | ||
|
e7a7713b80 | ||
|
52a580d845 | ||
|
ea42a0b5f5 | ||
|
a0b63da9a6 | ||
|
8d9932fc42 | ||
|
54be45bedc | ||
|
3c9d2a562b | ||
|
654bd5175c | ||
|
9db660cd3f | ||
|
9aeadff9bd | ||
|
cd631b789b | ||
|
4d98408aaf | ||
|
490aafba4e | ||
|
3cd31d49bb | ||
|
6dd78b8d35 | ||
|
bd51c34098 | ||
|
0e758fadee | ||
|
a67659ff8e | ||
|
d1203f90da | ||
|
c5f6ebee18 | ||
|
41cc5234c4 | ||
|
c2d3e5f052 | ||
|
f944b95e32 | ||
|
0a5b919cd9 | ||
|
b5f85c11fe | ||
|
5d44b5e913 | ||
|
dd1961d86c | ||
|
f3539bf448 | ||
|
d831e559f0 | ||
|
cc079660f3 | ||
|
4460dac697 | ||
|
31190f921c | ||
|
22515d8dce | ||
|
a099d970a4 | ||
|
95bb2c5504 | ||
|
0b1262cc4d | ||
|
f9244f6f7e | ||
|
cfa1bf36de | ||
|
c362b33b5a | ||
|
222a151eff | ||
|
d6115cff25 | ||
|
6459522617 | ||
|
16e1f0eea1 | ||
|
0564ac1530 | ||
|
b896f82282 | ||
|
d737d419d9 | ||
|
0de2b6983b | ||
|
25628c34ee | ||
|
54fdccd397 | ||
|
27af4a988d | ||
|
fddad131a2 | ||
|
4d493eeebd | ||
|
14c1495a1a | ||
|
49c029ddb3 | ||
|
ddbe142c4c | ||
|
4710b40e45 | ||
|
be0b296769 | ||
|
0a0ee67740 | ||
|
943d648225 | ||
|
6d835f5cc1 | ||
|
a59cd67acf | ||
|
bbc06be091 | ||
|
d303e9f347 | ||
|
85ee923d89 | ||
|
fe6ba20ff5 | ||
|
18acf50b12 | ||
|
509fabb61c | ||
|
cc3378b4cd | ||
|
8d3ccf333d | ||
|
520919b165 | ||
|
600b86dd31 | ||
|
9c3fdd2584 | ||
|
73974cd90f | ||
|
8a60b3b402 | ||
|
59ed5ae6b7 | ||
|
c687385974 | ||
|
2f72e15ea7 | ||
|
7ea99baeb2 | ||
|
14f3d20772 | ||
|
72f51df25f | ||
|
a94b58e304 | ||
|
d327fabf9c | ||
|
9e02888c74 | ||
|
98c9a847f3 | ||
|
a159f4c9d6 | ||
|
b197731ed2 | ||
|
028f54fdf0 | ||
|
de62a0f8ed | ||
|
a0fcc50a5f | ||
|
4f186e843c | ||
|
df64c20587 | ||
|
310c18707b | ||
|
422a4a5578 | ||
|
a995b2e1ae | ||
|
90ad681a9e | ||
|
5fd359a64f |
@@ -124,6 +124,7 @@ jobs:
|
||||
- repo-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- run: yarn wsrun test:circleci @0x/contracts-test-utils
|
||||
- run: yarn wsrun test:circleci @0x/abi-gen
|
||||
- run: yarn wsrun test:circleci @0x/asset-buyer
|
||||
- run: yarn wsrun test:circleci @0x/contract-artifacts
|
||||
- run: yarn wsrun test:circleci @0x/assert
|
||||
- run: yarn wsrun test:circleci @0x/base-contract
|
||||
@@ -149,6 +150,10 @@ jobs:
|
||||
key: coverage-assert-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/packages/assert/coverage/lcov.info
|
||||
- save_cache:
|
||||
key: coverage-asset-buyer-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/packages/asset-buyer/coverage/lcov.info
|
||||
- save_cache:
|
||||
key: coverage-base-contract-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
@@ -327,6 +332,9 @@ jobs:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-assert-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-asset-buyer-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-base-contract-{{ .Environment.CIRCLE_SHA1 }}
|
||||
|
@@ -1,4 +1,32 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "2.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557799313,
|
||||
"version": "2.1.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Update tests to use contract-built-in `awaitTransactionSuccessAsync`",
|
||||
"pr": 1797
|
||||
}
|
||||
],
|
||||
"timestamp": 1557507213
|
||||
},
|
||||
{
|
||||
"version": "2.1.1",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.4 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.3 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.2 - _May 10, 2019_
|
||||
|
||||
* Update tests to use contract-built-in `awaitTransactionSuccessAsync` (#1797)
|
||||
|
||||
## v2.1.1 - _April 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"artifactsDir": "./generated-artifacts",
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": true,
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "constantinople",
|
||||
@@ -30,6 +30,7 @@
|
||||
"src/MultiAssetProxy.sol",
|
||||
"src/interfaces/IAssetData.sol",
|
||||
"src/interfaces/IAssetProxy.sol",
|
||||
"src/interfaces/IAuthorizable.sol"
|
||||
"src/interfaces/IAuthorizable.sol",
|
||||
"src/libs/LibAssetData.sol"
|
||||
]
|
||||
}
|
||||
|
420
contracts/asset-proxy/contracts/src/libs/LibAssetData.sol
Normal file
420
contracts/asset-proxy/contracts/src/libs/LibAssetData.sol
Normal file
@@ -0,0 +1,420 @@
|
||||
/*
|
||||
|
||||
Copyright 2019 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.5.5;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
|
||||
import "@0x/contracts-erc1155/contracts/src/interfaces/IERC1155.sol";
|
||||
import "@0x/contracts-erc20/contracts/src/interfaces/IERC20Token.sol";
|
||||
import "@0x/contracts-erc721/contracts/src/interfaces/IERC721Token.sol";
|
||||
|
||||
|
||||
library LibAssetData {
|
||||
bytes4 constant public ERC20_PROXY_ID = bytes4(keccak256("ERC20Token(address)"));
|
||||
bytes4 constant public ERC721_PROXY_ID = bytes4(keccak256("ERC721Token(address,uint256)"));
|
||||
bytes4 constant public ERC1155_PROXY_ID = bytes4(keccak256("ERC1155Assets(address,uint256[],uint256[],bytes)"));
|
||||
bytes4 constant public MULTI_ASSET_PROXY_ID = bytes4(keccak256("MultiAsset(uint256[],bytes[])"));
|
||||
|
||||
/// @dev Returns the owner's balance of the token(s) specified in
|
||||
/// assetData. When the asset data contains multiple tokens (eg in
|
||||
/// ERC1155 or Multi-Asset), the return value indicates how many
|
||||
/// complete "baskets" of those tokens are owned by owner.
|
||||
/// @param owner Owner of the tokens specified by assetData.
|
||||
/// @param assetData Description of tokens, per the AssetProxy contract
|
||||
/// specification.
|
||||
/// @return Number of tokens (or token baskets) held by owner.
|
||||
function getBalance(address owner, bytes memory assetData)
|
||||
public
|
||||
view
|
||||
returns (uint256 balance)
|
||||
{
|
||||
bytes4 proxyId = LibBytes.readBytes4(assetData, 0);
|
||||
if (proxyId == ERC20_PROXY_ID) {
|
||||
address tokenAddress = LibBytes.readAddress(assetData, 16);
|
||||
return IERC20Token(tokenAddress).balanceOf(owner);
|
||||
} else if (proxyId == ERC721_PROXY_ID) {
|
||||
(, address tokenAddress, uint256 tokenId) = decodeERC721AssetData(assetData);
|
||||
return getERC721TokenOwner(tokenAddress, tokenId) == owner ? 1 : 0;
|
||||
} else if (proxyId == ERC1155_PROXY_ID) {
|
||||
uint256 lowestTokenBalance = 0;
|
||||
(
|
||||
,
|
||||
address tokenAddress,
|
||||
uint256[] memory tokenIds,
|
||||
uint256[] memory tokenValues,
|
||||
) = decodeERC1155AssetData(assetData);
|
||||
for (uint256 i = 0; i < tokenIds.length; i++) {
|
||||
uint256 tokenBalance = IERC1155(tokenAddress).balanceOf(owner, tokenIds[i]) / tokenValues[i];
|
||||
if (tokenBalance < lowestTokenBalance || lowestTokenBalance == 0) {
|
||||
lowestTokenBalance = tokenBalance;
|
||||
}
|
||||
}
|
||||
return lowestTokenBalance;
|
||||
} else if (proxyId == MULTI_ASSET_PROXY_ID) {
|
||||
uint256 lowestAssetBalance = 0;
|
||||
(, uint256[] memory assetAmounts, bytes[] memory nestedAssetData) = decodeMultiAssetData(assetData);
|
||||
for (uint256 i = 0; i < nestedAssetData.length; i++) {
|
||||
uint256 assetBalance = getBalance(owner, nestedAssetData[i]) / assetAmounts[i];
|
||||
if (assetBalance < lowestAssetBalance || lowestAssetBalance == 0) {
|
||||
lowestAssetBalance = assetBalance;
|
||||
}
|
||||
}
|
||||
return lowestAssetBalance;
|
||||
} else {
|
||||
revert("UNSUPPORTED_PROXY_IDENTIFIER");
|
||||
}
|
||||
}
|
||||
|
||||
/// @dev Calls getBalance() for each element of assetData.
|
||||
/// @param owner Owner of the tokens specified by assetData.
|
||||
/// @param assetData Array of token descriptors, each encoded per the
|
||||
/// AssetProxy contract specification.
|
||||
/// @return Array of token balances from getBalance(), with each element
|
||||
/// corresponding to the same-indexed element in the assetData input.
|
||||
function getBatchBalances(address owner, bytes[] memory assetData)
|
||||
public
|
||||
view
|
||||
returns (uint256[] memory balances)
|
||||
{
|
||||
balances = new uint256[](assetData.length);
|
||||
for (uint256 i = 0; i < assetData.length; i++) {
|
||||
balances[i] = getBalance(owner, assetData[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/// @dev Returns the number of token(s) (described by assetData) that
|
||||
/// spender is authorized to spend. When the asset data contains
|
||||
/// multiple tokens (eg for Multi-Asset), the return value indicates
|
||||
/// how many complete "baskets" of those tokens may be spent by spender.
|
||||
/// @param owner Owner of the tokens specified by assetData.
|
||||
/// @param spender Address whose authority to spend is in question.
|
||||
/// @param assetData Description of tokens, per the AssetProxy contract
|
||||
/// specification.
|
||||
/// @return Number of tokens (or token baskets) that the spender is
|
||||
/// authorized to spend.
|
||||
function getAllowance(address owner, address spender, bytes memory assetData)
|
||||
public
|
||||
view
|
||||
returns (uint256 allowance)
|
||||
{
|
||||
bytes4 proxyId = LibBytes.readBytes4(assetData, 0);
|
||||
|
||||
if (proxyId == ERC20_PROXY_ID) {
|
||||
address tokenAddress = LibBytes.readAddress(assetData, 16);
|
||||
return IERC20Token(tokenAddress).allowance(owner, spender);
|
||||
} else if (proxyId == ERC721_PROXY_ID) {
|
||||
(, address tokenAddress, uint256 tokenId) = decodeERC721AssetData(assetData);
|
||||
IERC721Token token = IERC721Token(tokenAddress);
|
||||
if (spender == token.getApproved(tokenId) || token.isApprovedForAll(owner, spender)) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else if (proxyId == ERC1155_PROXY_ID) {
|
||||
(, address tokenAddress, , , ) = decodeERC1155AssetData(assetData);
|
||||
if (IERC1155(tokenAddress).isApprovedForAll(owner, spender)) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else if (proxyId == MULTI_ASSET_PROXY_ID) {
|
||||
uint256 lowestAssetAllowance = 0;
|
||||
// solhint-disable-next-line indent
|
||||
(, uint256[] memory amounts, bytes[] memory nestedAssetData) = decodeMultiAssetData(assetData);
|
||||
for (uint256 i = 0; i < nestedAssetData.length; i++) {
|
||||
uint256 assetAllowance = getAllowance(owner, spender, nestedAssetData[i]) / amounts[i];
|
||||
if (assetAllowance < lowestAssetAllowance || lowestAssetAllowance == 0) {
|
||||
lowestAssetAllowance = assetAllowance;
|
||||
}
|
||||
}
|
||||
return lowestAssetAllowance;
|
||||
} else {
|
||||
revert("UNSUPPORTED_PROXY_IDENTIFIER");
|
||||
}
|
||||
}
|
||||
|
||||
/// @dev Calls getAllowance() for each element of assetData.
|
||||
/// @param owner Owner of the tokens specified by assetData.
|
||||
/// @param spender Address whose authority to spend is in question.
|
||||
/// @param assetData Description of tokens, per the AssetProxy contract
|
||||
/// specification.
|
||||
/// @return An array of token allowances from getAllowance(), with each
|
||||
/// element corresponding to the same-indexed element in the assetData
|
||||
/// input.
|
||||
function getBatchAllowances(address owner, address spender, bytes[] memory assetData)
|
||||
public
|
||||
view
|
||||
returns (uint256[] memory allowances)
|
||||
{
|
||||
allowances = new uint256[](assetData.length);
|
||||
for (uint256 i = 0; i < assetData.length; i++) {
|
||||
allowances[i] = getAllowance(owner, spender, assetData[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/// @dev Calls getBalance() and getAllowance() for assetData.
|
||||
/// @param owner Owner of the tokens specified by assetData.
|
||||
/// @param spender Address whose authority to spend is in question.
|
||||
/// @param assetData Description of tokens, per the AssetProxy contract
|
||||
/// specification.
|
||||
/// @return Number of tokens (or token baskets) held by owner, and number
|
||||
/// of tokens (or token baskets) that the spender is authorized to
|
||||
/// spend.
|
||||
function getBalanceAndAllowance(address owner, address spender, bytes memory assetData)
|
||||
public
|
||||
view
|
||||
returns (uint256 balance, uint256 allowance)
|
||||
{
|
||||
balance = getBalance(owner, assetData);
|
||||
allowance = getAllowance(owner, spender, assetData);
|
||||
}
|
||||
|
||||
/// @dev Calls getBatchBalances() and getBatchAllowances() for each element
|
||||
/// of assetData.
|
||||
/// @param owner Owner of the tokens specified by assetData.
|
||||
/// @param spender Address whose authority to spend is in question.
|
||||
/// @param assetData Description of tokens, per the AssetProxy contract
|
||||
/// specification.
|
||||
/// @return An array of token balances from getBalance(), and an array of
|
||||
/// token allowances from getAllowance(), with each element
|
||||
/// corresponding to the same-indexed element in the assetData input.
|
||||
function getBatchBalancesAndAllowances(address owner, address spender, bytes[] memory assetData)
|
||||
public
|
||||
view
|
||||
returns (uint256[] memory balances, uint256[] memory allowances)
|
||||
{
|
||||
balances = getBatchBalances(owner, assetData);
|
||||
allowances = getBatchAllowances(owner, spender, assetData);
|
||||
}
|
||||
|
||||
/// @dev Encode ERC-20 asset data into the format described in the
|
||||
/// AssetProxy contract specification.
|
||||
/// @param tokenAddress The address of the ERC-20 contract hosting the
|
||||
/// token to be traded.
|
||||
/// @return AssetProxy-compliant data describing the asset.
|
||||
function encodeERC20AssetData(address tokenAddress)
|
||||
public
|
||||
pure
|
||||
returns (bytes memory assetData)
|
||||
{
|
||||
return abi.encodeWithSelector(ERC20_PROXY_ID, tokenAddress);
|
||||
}
|
||||
|
||||
/// @dev Decode ERC-20 asset data from the format described in the
|
||||
/// AssetProxy contract specification.
|
||||
/// @param assetData AssetProxy-compliant asset data describing an ERC-20
|
||||
/// asset.
|
||||
/// @return The ERC-20 AssetProxy identifier, and the address of the ERC-20
|
||||
/// contract hosting this asset.
|
||||
function decodeERC20AssetData(bytes memory assetData)
|
||||
public
|
||||
pure
|
||||
returns (
|
||||
bytes4 proxyId,
|
||||
address tokenAddress
|
||||
)
|
||||
{
|
||||
proxyId = LibBytes.readBytes4(assetData, 0);
|
||||
|
||||
require(proxyId == ERC20_PROXY_ID, "WRONG_PROXY_ID");
|
||||
|
||||
tokenAddress = LibBytes.readAddress(assetData, 16);
|
||||
}
|
||||
|
||||
/// @dev Encode ERC-721 asset data into the format described in the
|
||||
/// AssetProxy specification.
|
||||
/// @param tokenAddress The address of the ERC-721 contract hosting the
|
||||
/// token to be traded.
|
||||
/// @param tokenId The identifier of the specific token to be traded.
|
||||
/// @return AssetProxy-compliant asset data describing the asset.
|
||||
function encodeERC721AssetData(
|
||||
address tokenAddress,
|
||||
uint256 tokenId
|
||||
)
|
||||
public
|
||||
pure
|
||||
returns (bytes memory assetData)
|
||||
{
|
||||
return abi.encodeWithSelector(ERC721_PROXY_ID, tokenAddress, tokenId);
|
||||
}
|
||||
|
||||
/// @dev Decode ERC-721 asset data from the format described in the
|
||||
/// AssetProxy contract specification.
|
||||
/// @param assetData AssetProxy-compliant asset data describing an ERC-721
|
||||
/// asset.
|
||||
/// @return The ERC-721 AssetProxy identifier, the address of the ERC-721
|
||||
/// contract hosting this asset, and the identifier of the specific
|
||||
/// token to be traded.
|
||||
function decodeERC721AssetData(bytes memory assetData)
|
||||
public
|
||||
pure
|
||||
returns (
|
||||
bytes4 proxyId,
|
||||
address tokenAddress,
|
||||
uint256 tokenId
|
||||
)
|
||||
{
|
||||
proxyId = LibBytes.readBytes4(assetData, 0);
|
||||
|
||||
require(proxyId == ERC721_PROXY_ID, "WRONG_PROXY_ID");
|
||||
|
||||
tokenAddress = LibBytes.readAddress(assetData, 16);
|
||||
tokenId = LibBytes.readUint256(assetData, 36);
|
||||
}
|
||||
|
||||
/// @dev Encode ERC-1155 asset data into the format described in the
|
||||
/// AssetProxy contract specification.
|
||||
/// @param tokenAddress The address of the ERC-1155 contract hosting the
|
||||
/// token(s) to be traded.
|
||||
/// @param tokenIds The identifiers of the specific tokens to be traded.
|
||||
/// @param tokenValues The amounts of each token to be traded.
|
||||
/// @param callbackData ...
|
||||
/// @return AssetProxy-compliant asset data describing the set of assets.
|
||||
function encodeERC1155AssetData(
|
||||
address tokenAddress,
|
||||
uint256[] memory tokenIds,
|
||||
uint256[] memory tokenValues,
|
||||
bytes memory callbackData
|
||||
)
|
||||
public
|
||||
pure
|
||||
returns (bytes memory assetData)
|
||||
{
|
||||
return abi.encodeWithSelector(ERC1155_PROXY_ID, tokenAddress, tokenIds, tokenValues, callbackData);
|
||||
}
|
||||
|
||||
/// @dev Decode ERC-1155 asset data from the format described in the
|
||||
/// AssetProxy contract specification.
|
||||
/// @param assetData AssetProxy-compliant asset data describing an ERC-1155
|
||||
/// set of assets.
|
||||
/// @return The ERC-1155 AssetProxy identifier, the address of the ERC-1155
|
||||
/// contract hosting the assets, an array of the identifiers of the
|
||||
/// tokens to be traded, an array of token amounts to be traded, and
|
||||
/// callback data. Each element of the arrays corresponds to the
|
||||
/// same-indexed element of the other array. Return values specified as
|
||||
/// `memory` are returned as pointers to locations within the memory of
|
||||
/// the input parameter `assetData`.
|
||||
function decodeERC1155AssetData(bytes memory assetData)
|
||||
public
|
||||
pure
|
||||
returns (
|
||||
bytes4 proxyId,
|
||||
address tokenAddress,
|
||||
uint256[] memory tokenIds,
|
||||
uint256[] memory tokenValues,
|
||||
bytes memory callbackData
|
||||
)
|
||||
{
|
||||
proxyId = LibBytes.readBytes4(assetData, 0);
|
||||
|
||||
require(proxyId == ERC1155_PROXY_ID, "WRONG_PROXY_ID");
|
||||
|
||||
assembly {
|
||||
// Skip selector and length to get to the first parameter:
|
||||
assetData := add(assetData, 36)
|
||||
// Read the value of the first parameter:
|
||||
tokenAddress := mload(assetData)
|
||||
// Point to the next parameter's data:
|
||||
tokenIds := add(assetData, mload(add(assetData, 32)))
|
||||
// Point to the next parameter's data:
|
||||
tokenValues := add(assetData, mload(add(assetData, 64)))
|
||||
// Point to the next parameter's data:
|
||||
callbackData := add(assetData, mload(add(assetData, 96)))
|
||||
}
|
||||
}
|
||||
|
||||
/// @dev Encode data for multiple assets, per the AssetProxy contract
|
||||
/// specification.
|
||||
/// @param amounts The amounts of each asset to be traded.
|
||||
/// @param nestedAssetData AssetProxy-compliant data describing each asset
|
||||
/// to be traded.
|
||||
/// @return AssetProxy-compliant data describing the set of assets.
|
||||
function encodeMultiAssetData(uint256[] memory amounts, bytes[] memory nestedAssetData)
|
||||
public
|
||||
pure
|
||||
returns (bytes memory assetData)
|
||||
{
|
||||
assetData = abi.encodeWithSelector(MULTI_ASSET_PROXY_ID, amounts, nestedAssetData);
|
||||
}
|
||||
|
||||
/// @dev Decode multi-asset data from the format described in the
|
||||
/// AssetProxy contract specification.
|
||||
/// @param assetData AssetProxy-compliant data describing a multi-asset
|
||||
/// basket.
|
||||
/// @return The Multi-Asset AssetProxy identifier, an array of the amounts
|
||||
/// of the assets to be traded, and an array of the
|
||||
/// AssetProxy-compliant data describing each asset to be traded. Each
|
||||
/// element of the arrays corresponds to the same-indexed element of
|
||||
/// the other array.
|
||||
function decodeMultiAssetData(bytes memory assetData)
|
||||
public
|
||||
pure
|
||||
returns (
|
||||
bytes4 proxyId,
|
||||
uint256[] memory amounts,
|
||||
bytes[] memory nestedAssetData
|
||||
)
|
||||
{
|
||||
proxyId = LibBytes.readBytes4(assetData, 0);
|
||||
|
||||
require(proxyId == MULTI_ASSET_PROXY_ID, "WRONG_PROXY_ID");
|
||||
|
||||
// solhint-disable-next-line indent
|
||||
(amounts, nestedAssetData) = abi.decode(LibBytes.slice(assetData, 4, assetData.length), (uint256[], bytes[]));
|
||||
}
|
||||
|
||||
/// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.
|
||||
/// @param token Address of ERC721 token.
|
||||
/// @param tokenId The identifier for the specific NFT.
|
||||
/// @return Owner of tokenId or null address if unowned.
|
||||
function getERC721TokenOwner(address token, uint256 tokenId)
|
||||
public
|
||||
view
|
||||
returns (address owner)
|
||||
{
|
||||
assembly {
|
||||
// load free memory pointer
|
||||
let cdStart := mload(64)
|
||||
|
||||
// bytes4(keccak256(ownerOf(uint256))) = 0x6352211e
|
||||
mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)
|
||||
mstore(add(cdStart, 4), tokenId)
|
||||
|
||||
// staticcall `ownerOf(tokenId)`
|
||||
// `ownerOf` will revert if tokenId is not owned
|
||||
let success := staticcall(
|
||||
gas, // forward all gas
|
||||
token, // call token contract
|
||||
cdStart, // start of calldata
|
||||
36, // length of input is 36 bytes
|
||||
cdStart, // write output over input
|
||||
32 // size of output is 32 bytes
|
||||
)
|
||||
|
||||
// Success implies that tokenId is owned
|
||||
// Copy owner from return data if successful
|
||||
if success {
|
||||
owner := mload(cdStart)
|
||||
}
|
||||
}
|
||||
|
||||
// Owner initialized to address(0), no need to modify if call is unsuccessful
|
||||
return owner;
|
||||
}
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-asset-proxy",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.4",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -34,7 +34,7 @@
|
||||
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
|
||||
},
|
||||
"config": {
|
||||
"abis": "./generated-artifacts/@(ERC1155Proxy|ERC20Proxy|ERC721Proxy|IAssetData|IAssetProxy|IAuthorizable|MixinAuthorizable|MultiAssetProxy).json",
|
||||
"abis": "./generated-artifacts/@(ERC1155Proxy|ERC20Proxy|ERC721Proxy|IAssetData|IAssetProxy|IAuthorizable|LibAssetData|MixinAuthorizable|MultiAssetProxy).json",
|
||||
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
|
||||
},
|
||||
"repository": {
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.9",
|
||||
"@0x/contracts-gen": "^1.0.8",
|
||||
"@0x/contracts-test-utils": "^3.1.2",
|
||||
"@0x/dev-utils": "^2.2.1",
|
||||
"@0x/sol-compiler": "^3.1.6",
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.6",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -68,16 +68,16 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.0.5",
|
||||
"@0x/contracts-erc1155": "^1.1.1",
|
||||
"@0x/contracts-erc20": "^2.2.0",
|
||||
"@0x/contracts-erc721": "^2.1.1",
|
||||
"@0x/contracts-utils": "^3.1.1",
|
||||
"@0x/order-utils": "^7.2.0",
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-erc1155": "^1.1.5",
|
||||
"@0x/contracts-erc20": "^2.2.4",
|
||||
"@0x/contracts-erc721": "^2.1.5",
|
||||
"@0x/contracts-utils": "^3.1.5",
|
||||
"@0x/order-utils": "^8.1.0",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.1",
|
||||
"@0x/web3-wrapper": "^6.0.5",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@0x/web3-wrapper": "^6.0.6",
|
||||
"ethereum-types": "^2.1.2",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -11,12 +11,14 @@ import * as ERC721Proxy from '../generated-artifacts/ERC721Proxy.json';
|
||||
import * as IAssetData from '../generated-artifacts/IAssetData.json';
|
||||
import * as IAssetProxy from '../generated-artifacts/IAssetProxy.json';
|
||||
import * as IAuthorizable from '../generated-artifacts/IAuthorizable.json';
|
||||
import * as LibAssetData from '../generated-artifacts/LibAssetData.json';
|
||||
import * as MixinAuthorizable from '../generated-artifacts/MixinAuthorizable.json';
|
||||
import * as MultiAssetProxy from '../generated-artifacts/MultiAssetProxy.json';
|
||||
export const artifacts = {
|
||||
LibAssetData: LibAssetData as ContractArtifact,
|
||||
ERC1155Proxy: ERC1155Proxy as ContractArtifact,
|
||||
ERC20Proxy: ERC20Proxy as ContractArtifact,
|
||||
ERC721Proxy: ERC721Proxy as ContractArtifact,
|
||||
ERC1155Proxy: ERC1155Proxy as ContractArtifact,
|
||||
MixinAuthorizable: MixinAuthorizable as ContractArtifact,
|
||||
MultiAssetProxy: MultiAssetProxy as ContractArtifact,
|
||||
IAssetData: IAssetData as ContractArtifact,
|
||||
|
@@ -9,5 +9,6 @@ export * from '../generated-wrappers/erc721_proxy';
|
||||
export * from '../generated-wrappers/i_asset_data';
|
||||
export * from '../generated-wrappers/i_asset_proxy';
|
||||
export * from '../generated-wrappers/i_authorizable';
|
||||
export * from '../generated-wrappers/lib_asset_data';
|
||||
export * from '../generated-wrappers/mixin_authorizable';
|
||||
export * from '../generated-wrappers/multi_asset_proxy';
|
||||
|
@@ -53,16 +53,18 @@ describe('Authorizable', () => {
|
||||
);
|
||||
});
|
||||
it('should allow owner to add an authorized address', async () => {
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
|
||||
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
address,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
const isAuthorized = await authorizable.authorized.callAsync(address);
|
||||
expect(isAuthorized).to.be.true();
|
||||
});
|
||||
it('should throw if owner attempts to authorize a duplicate address', async () => {
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
|
||||
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
address,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
return expectTransactionFailedAsync(
|
||||
@@ -74,8 +76,9 @@ describe('Authorizable', () => {
|
||||
|
||||
describe('removeAuthorizedAddress', () => {
|
||||
it('should throw if not called by owner', async () => {
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
|
||||
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
address,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
return expectTransactionFailedAsync(
|
||||
@@ -87,14 +90,14 @@ describe('Authorizable', () => {
|
||||
});
|
||||
|
||||
it('should allow owner to remove an authorized address', async () => {
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
|
||||
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
address,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await authorizable.removeAuthorizedAddress.sendTransactionAsync(address, {
|
||||
from: owner,
|
||||
}),
|
||||
await authorizable.removeAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
address,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
const isAuthorized = await authorizable.authorized.callAsync(address);
|
||||
@@ -113,8 +116,9 @@ describe('Authorizable', () => {
|
||||
|
||||
describe('removeAuthorizedAddressAtIndex', () => {
|
||||
it('should throw if not called by owner', async () => {
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
|
||||
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
address,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
const index = new BigNumber(0);
|
||||
@@ -126,8 +130,9 @@ describe('Authorizable', () => {
|
||||
);
|
||||
});
|
||||
it('should throw if index is >= authorities.length', async () => {
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
|
||||
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
address,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
const index = new BigNumber(1);
|
||||
@@ -150,12 +155,14 @@ describe('Authorizable', () => {
|
||||
it('should throw if address at index does not match target', async () => {
|
||||
const address1 = address;
|
||||
const address2 = notOwner;
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await authorizable.addAuthorizedAddress.sendTransactionAsync(address1, { from: owner }),
|
||||
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
address1,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await authorizable.addAuthorizedAddress.sendTransactionAsync(address2, { from: owner }),
|
||||
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
address2,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
const address1Index = new BigNumber(0);
|
||||
@@ -167,15 +174,16 @@ describe('Authorizable', () => {
|
||||
);
|
||||
});
|
||||
it('should allow owner to remove an authorized address', async () => {
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
|
||||
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
address,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
const index = new BigNumber(0);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await authorizable.removeAuthorizedAddressAtIndex.sendTransactionAsync(address, index, {
|
||||
from: owner,
|
||||
}),
|
||||
await authorizable.removeAuthorizedAddressAtIndex.awaitTransactionSuccessAsync(
|
||||
address,
|
||||
index,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
const isAuthorized = await authorizable.authorized.callAsync(address);
|
||||
@@ -187,20 +195,17 @@ describe('Authorizable', () => {
|
||||
it('should return all authorized addresses', async () => {
|
||||
const initial = await authorizable.getAuthorizedAddresses.callAsync();
|
||||
expect(initial).to.have.length(0);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, {
|
||||
from: owner,
|
||||
}),
|
||||
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
address,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
const afterAdd = await authorizable.getAuthorizedAddresses.callAsync();
|
||||
expect(afterAdd).to.have.length(1);
|
||||
expect(afterAdd).to.include(address);
|
||||
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await authorizable.removeAuthorizedAddress.sendTransactionAsync(address, {
|
||||
from: owner,
|
||||
}),
|
||||
await authorizable.removeAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
address,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
const afterRemove = await authorizable.getAuthorizedAddresses.callAsync();
|
||||
|
@@ -70,16 +70,14 @@ describe('ERC1155Proxy', () => {
|
||||
const usedAddresses = ([owner, notAuthorized, authorized, spender, receiver] = _.slice(accounts, 0, 5));
|
||||
erc1155ProxyWrapper = new ERC1155ProxyWrapper(provider, usedAddresses, owner);
|
||||
erc1155Proxy = await erc1155ProxyWrapper.deployProxyAsync();
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc1155Proxy.addAuthorizedAddress.sendTransactionAsync(authorized, {
|
||||
from: owner,
|
||||
}),
|
||||
await erc1155Proxy.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
authorized,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc1155Proxy.addAuthorizedAddress.sendTransactionAsync(erc1155Proxy.address, {
|
||||
from: owner,
|
||||
}),
|
||||
await erc1155Proxy.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
erc1155Proxy.address,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
// deploy & configure ERC1155 tokens and receiver
|
||||
@@ -596,8 +594,8 @@ describe('ERC1155Proxy', () => {
|
||||
it('should propagate revert reason from erc1155 contract failure', async () => {
|
||||
// disable transfers
|
||||
const shouldRejectTransfer = true;
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc1155Receiver.setRejectTransferFlag.sendTransactionAsync(shouldRejectTransfer),
|
||||
await erc1155Receiver.setRejectTransferFlag.awaitTransactionSuccessAsync(
|
||||
shouldRejectTransfer,
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
// setup test parameters
|
||||
|
426
contracts/asset-proxy/test/lib_asset_data.ts
Normal file
426
contracts/asset-proxy/test/lib_asset_data.ts
Normal file
@@ -0,0 +1,426 @@
|
||||
// TODO: change test titles to say "... from asset data"
|
||||
import * as chai from 'chai';
|
||||
import { LogWithDecodedArgs } from 'ethereum-types';
|
||||
|
||||
import {
|
||||
artifacts as erc1155Artifacts,
|
||||
ERC1155MintableContract,
|
||||
ERC1155TransferSingleEventArgs,
|
||||
IERC1155MintableContract,
|
||||
} from '@0x/contracts-erc1155';
|
||||
import { artifacts as erc20Artifacts, DummyERC20TokenContract, IERC20TokenContract } from '@0x/contracts-erc20';
|
||||
import { artifacts as erc721Artifacts, DummyERC721TokenContract, IERC721TokenContract } from '@0x/contracts-erc721';
|
||||
import { chaiSetup, constants, LogDecoder, provider, txDefaults, web3Wrapper } from '@0x/contracts-test-utils';
|
||||
import { BlockchainLifecycle } from '@0x/dev-utils';
|
||||
import { AssetProxyId } from '@0x/types';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
|
||||
import { artifacts, LibAssetDataContract } from '../src';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
|
||||
const KNOWN_ERC20_ENCODING = {
|
||||
address: '0x1dc4c1cefef38a777b15aa20260a54e584b16c48',
|
||||
assetData: '0xf47261b00000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c48',
|
||||
};
|
||||
const KNOWN_ERC721_ENCODING = {
|
||||
address: '0x1dc4c1cefef38a777b15aa20260a54e584b16c48',
|
||||
tokenId: new BigNumber(1),
|
||||
assetData:
|
||||
'0x025717920000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c480000000000000000000000000000000000000000000000000000000000000001',
|
||||
};
|
||||
const KNOWN_ERC1155_ENCODING = {
|
||||
tokenAddress: '0x1dc4c1cefef38a777b15aa20260a54e584b16c48',
|
||||
tokenIds: [new BigNumber(100), new BigNumber(1001), new BigNumber(10001)],
|
||||
tokenValues: [new BigNumber(200), new BigNumber(2001), new BigNumber(20001)],
|
||||
callbackData:
|
||||
'0x025717920000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c480000000000000000000000000000000000000000000000000000000000000001',
|
||||
assetData:
|
||||
'0xa7cb5fb70000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c480000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000003e90000000000000000000000000000000000000000000000000000000000002711000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000007d10000000000000000000000000000000000000000000000000000000000004e210000000000000000000000000000000000000000000000000000000000000044025717920000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c48000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000',
|
||||
};
|
||||
const KNOWN_MULTI_ASSET_ENCODING = {
|
||||
amounts: [new BigNumber(70), new BigNumber(1), new BigNumber(18)],
|
||||
nestedAssetData: [
|
||||
KNOWN_ERC20_ENCODING.assetData,
|
||||
KNOWN_ERC721_ENCODING.assetData,
|
||||
KNOWN_ERC1155_ENCODING.assetData,
|
||||
],
|
||||
assetData:
|
||||
'0x94cfcdd7000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000024f47261b00000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c48000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044025717920000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c480000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000204a7cb5fb70000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c480000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000003e90000000000000000000000000000000000000000000000000000000000002711000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000007d10000000000000000000000000000000000000000000000000000000000004e210000000000000000000000000000000000000000000000000000000000000044025717920000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c4800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
|
||||
};
|
||||
|
||||
describe('LibAssetData', () => {
|
||||
let libAssetData: LibAssetDataContract;
|
||||
|
||||
let tokenOwnerAddress: string;
|
||||
let approvedSpenderAddress: string;
|
||||
let anotherApprovedSpenderAddress: string;
|
||||
|
||||
let erc20TokenAddress: string;
|
||||
const erc20TokenTotalSupply = new BigNumber(1);
|
||||
|
||||
let erc721TokenAddress: string;
|
||||
const firstERC721TokenId = new BigNumber(1);
|
||||
const numberOfERC721Tokens = 10;
|
||||
|
||||
let erc1155MintableAddress: string;
|
||||
let erc1155TokenId: BigNumber;
|
||||
|
||||
before(async () => {
|
||||
await blockchainLifecycle.startAsync();
|
||||
|
||||
libAssetData = await LibAssetDataContract.deployFrom0xArtifactAsync(
|
||||
artifacts.LibAssetData,
|
||||
provider,
|
||||
txDefaults,
|
||||
);
|
||||
|
||||
[
|
||||
tokenOwnerAddress,
|
||||
approvedSpenderAddress,
|
||||
anotherApprovedSpenderAddress,
|
||||
] = await web3Wrapper.getAvailableAddressesAsync();
|
||||
|
||||
erc20TokenAddress = (await DummyERC20TokenContract.deployFrom0xArtifactAsync(
|
||||
erc20Artifacts.DummyERC20Token,
|
||||
provider,
|
||||
txDefaults,
|
||||
'Dummy',
|
||||
'DUM',
|
||||
new BigNumber(1),
|
||||
erc20TokenTotalSupply,
|
||||
)).address;
|
||||
|
||||
const erc721TokenContract = await DummyERC721TokenContract.deployFrom0xArtifactAsync(
|
||||
erc721Artifacts.DummyERC721Token,
|
||||
provider,
|
||||
txDefaults,
|
||||
'Dummy',
|
||||
'DUM',
|
||||
);
|
||||
erc721TokenAddress = erc721TokenContract.address;
|
||||
// mint `numberOfERC721Tokens` tokens
|
||||
const transactionMinedPromises = [];
|
||||
for (let i = 0; i < numberOfERC721Tokens; i++) {
|
||||
transactionMinedPromises.push(
|
||||
web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc721TokenContract.mint.sendTransactionAsync(
|
||||
tokenOwnerAddress,
|
||||
firstERC721TokenId.plus(i - 1),
|
||||
),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
),
|
||||
);
|
||||
}
|
||||
await Promise.all(transactionMinedPromises);
|
||||
|
||||
const erc1155MintableContract = await ERC1155MintableContract.deployFrom0xArtifactAsync(
|
||||
erc1155Artifacts.ERC1155Mintable,
|
||||
provider,
|
||||
txDefaults,
|
||||
);
|
||||
erc1155MintableAddress = erc1155MintableContract.address;
|
||||
// Somewhat re-inventing the wheel here, but the prior art currently
|
||||
// exists only as an unexported test util in the erc1155 package
|
||||
// (Erc1155Wrapper.mintFungibleTokensAsync() in erc1155/test/utils/).
|
||||
// This is concise enough to justify duplication, but it sure is ugly.
|
||||
// tslint:disable-next-line no-unnecessary-type-assertion
|
||||
erc1155TokenId = ((await new LogDecoder(web3Wrapper, erc1155Artifacts).getTxWithDecodedLogsAsync(
|
||||
await erc1155MintableContract.create.sendTransactionAsync('uri:Dummy', /*isNonFungible:*/ false),
|
||||
)).logs[0] as LogWithDecodedArgs<ERC1155TransferSingleEventArgs>).args.id;
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc1155MintableContract.mintFungible.sendTransactionAsync(
|
||||
erc1155TokenId,
|
||||
[tokenOwnerAddress],
|
||||
[new BigNumber(1)],
|
||||
),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
});
|
||||
|
||||
async function setERC20AllowanceAsync(): Promise<any> {
|
||||
return web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await new IERC20TokenContract(
|
||||
erc20Artifacts.IERC20Token.compilerOutput.abi,
|
||||
erc20TokenAddress,
|
||||
provider,
|
||||
).approve.sendTransactionAsync(approvedSpenderAddress, new BigNumber(1), { from: tokenOwnerAddress }),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
}
|
||||
|
||||
async function setERC721AllowanceAsync(): Promise<any> {
|
||||
return web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await new IERC721TokenContract(
|
||||
erc721Artifacts.IERC721Token.compilerOutput.abi,
|
||||
erc721TokenAddress,
|
||||
provider,
|
||||
).approve.sendTransactionAsync(approvedSpenderAddress, new BigNumber(1), { from: tokenOwnerAddress }),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
}
|
||||
|
||||
after(async () => {
|
||||
await blockchainLifecycle.revertAsync();
|
||||
});
|
||||
|
||||
it('should have a deployed-to address', () => {
|
||||
expect(libAssetData.address.slice(0, 2)).to.equal('0x');
|
||||
});
|
||||
|
||||
it('should encode ERC20 asset data', async () => {
|
||||
expect(await libAssetData.encodeERC20AssetData.callAsync(KNOWN_ERC20_ENCODING.address)).to.equal(
|
||||
KNOWN_ERC20_ENCODING.assetData,
|
||||
);
|
||||
});
|
||||
|
||||
it('should decode ERC20 asset data', async () => {
|
||||
expect(await libAssetData.decodeERC20AssetData.callAsync(KNOWN_ERC20_ENCODING.assetData)).to.deep.equal([
|
||||
AssetProxyId.ERC20,
|
||||
KNOWN_ERC20_ENCODING.address,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should encode ERC721 asset data', async () => {
|
||||
expect(
|
||||
await libAssetData.encodeERC721AssetData.callAsync(
|
||||
KNOWN_ERC721_ENCODING.address,
|
||||
KNOWN_ERC721_ENCODING.tokenId,
|
||||
),
|
||||
).to.equal(KNOWN_ERC721_ENCODING.assetData);
|
||||
});
|
||||
|
||||
it('should decode ERC721 asset data', async () => {
|
||||
expect(await libAssetData.decodeERC721AssetData.callAsync(KNOWN_ERC721_ENCODING.assetData)).to.deep.equal([
|
||||
AssetProxyId.ERC721,
|
||||
KNOWN_ERC721_ENCODING.address,
|
||||
KNOWN_ERC721_ENCODING.tokenId,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should encode ERC1155 asset data', async () => {
|
||||
expect(
|
||||
await libAssetData.encodeERC1155AssetData.callAsync(
|
||||
KNOWN_ERC1155_ENCODING.tokenAddress,
|
||||
KNOWN_ERC1155_ENCODING.tokenIds,
|
||||
KNOWN_ERC1155_ENCODING.tokenValues,
|
||||
KNOWN_ERC1155_ENCODING.callbackData,
|
||||
),
|
||||
).to.equal(KNOWN_ERC1155_ENCODING.assetData);
|
||||
});
|
||||
|
||||
it('should decode ERC1155 asset data', async () => {
|
||||
expect(await libAssetData.decodeERC1155AssetData.callAsync(KNOWN_ERC1155_ENCODING.assetData)).to.deep.equal([
|
||||
AssetProxyId.ERC1155,
|
||||
KNOWN_ERC1155_ENCODING.tokenAddress,
|
||||
KNOWN_ERC1155_ENCODING.tokenIds,
|
||||
KNOWN_ERC1155_ENCODING.tokenValues,
|
||||
KNOWN_ERC1155_ENCODING.callbackData,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should encode multiasset data', async () => {
|
||||
expect(
|
||||
await libAssetData.encodeMultiAssetData.callAsync(
|
||||
KNOWN_MULTI_ASSET_ENCODING.amounts,
|
||||
KNOWN_MULTI_ASSET_ENCODING.nestedAssetData,
|
||||
),
|
||||
).to.equal(KNOWN_MULTI_ASSET_ENCODING.assetData);
|
||||
});
|
||||
|
||||
it('should decode multiasset data', async () => {
|
||||
expect(await libAssetData.decodeMultiAssetData.callAsync(KNOWN_MULTI_ASSET_ENCODING.assetData)).to.deep.equal([
|
||||
AssetProxyId.MultiAsset,
|
||||
KNOWN_MULTI_ASSET_ENCODING.amounts,
|
||||
KNOWN_MULTI_ASSET_ENCODING.nestedAssetData,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should query ERC20 balance by asset data', async () => {
|
||||
expect(
|
||||
await libAssetData.getBalance.callAsync(
|
||||
tokenOwnerAddress,
|
||||
await libAssetData.encodeERC20AssetData.callAsync(erc20TokenAddress),
|
||||
),
|
||||
).to.bignumber.equal(erc20TokenTotalSupply);
|
||||
});
|
||||
|
||||
it('should query ERC721 balance by asset data', async () => {
|
||||
expect(
|
||||
await libAssetData.getBalance.callAsync(
|
||||
tokenOwnerAddress,
|
||||
await libAssetData.encodeERC721AssetData.callAsync(erc721TokenAddress, firstERC721TokenId),
|
||||
),
|
||||
).to.bignumber.equal(1);
|
||||
});
|
||||
|
||||
it('should query ERC1155 balances by asset data', async () => {
|
||||
expect(
|
||||
await libAssetData.getBalance.callAsync(
|
||||
tokenOwnerAddress,
|
||||
await libAssetData.encodeERC1155AssetData.callAsync(
|
||||
erc1155MintableAddress,
|
||||
[erc1155TokenId],
|
||||
[new BigNumber(1)], // token values
|
||||
'0x', // callback data
|
||||
),
|
||||
),
|
||||
).to.bignumber.equal(1);
|
||||
});
|
||||
|
||||
it('should query multi-asset batch balance by asset data', async () => {
|
||||
expect(
|
||||
await libAssetData.getBalance.callAsync(
|
||||
tokenOwnerAddress,
|
||||
await libAssetData.encodeMultiAssetData.callAsync(
|
||||
[new BigNumber(1), new BigNumber(1)],
|
||||
[
|
||||
await libAssetData.encodeERC20AssetData.callAsync(erc20TokenAddress),
|
||||
await libAssetData.encodeERC721AssetData.callAsync(erc721TokenAddress, firstERC721TokenId),
|
||||
],
|
||||
),
|
||||
),
|
||||
).to.bignumber.equal(Math.min(erc20TokenTotalSupply.toNumber(), numberOfERC721Tokens));
|
||||
});
|
||||
|
||||
it('should query ERC20 allowances by asset data', async () => {
|
||||
await setERC20AllowanceAsync();
|
||||
expect(
|
||||
await libAssetData.getAllowance.callAsync(
|
||||
tokenOwnerAddress,
|
||||
approvedSpenderAddress,
|
||||
await libAssetData.encodeERC20AssetData.callAsync(erc20TokenAddress),
|
||||
),
|
||||
).to.bignumber.equal(1);
|
||||
});
|
||||
|
||||
it('should query ERC721 approval by asset data', async () => {
|
||||
await setERC721AllowanceAsync();
|
||||
expect(
|
||||
await libAssetData.getAllowance.callAsync(
|
||||
tokenOwnerAddress,
|
||||
approvedSpenderAddress,
|
||||
await libAssetData.encodeERC721AssetData.callAsync(erc721TokenAddress, firstERC721TokenId),
|
||||
),
|
||||
).to.bignumber.equal(1);
|
||||
});
|
||||
|
||||
it('should query ERC721 approvalForAll by assetData', async () => {
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await new IERC721TokenContract(
|
||||
erc721Artifacts.IERC721Token.compilerOutput.abi,
|
||||
erc721TokenAddress,
|
||||
provider,
|
||||
).setApprovalForAll.sendTransactionAsync(anotherApprovedSpenderAddress, true, {
|
||||
from: tokenOwnerAddress,
|
||||
}),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
expect(
|
||||
await libAssetData.getAllowance.callAsync(
|
||||
tokenOwnerAddress,
|
||||
anotherApprovedSpenderAddress,
|
||||
await libAssetData.encodeERC721AssetData.callAsync(erc721TokenAddress, firstERC721TokenId),
|
||||
),
|
||||
).to.bignumber.equal(1);
|
||||
});
|
||||
|
||||
it('should query ERC1155 allowances by asset data', async () => {
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await new IERC1155MintableContract(
|
||||
erc1155Artifacts.IERC1155Mintable.compilerOutput.abi,
|
||||
erc1155MintableAddress,
|
||||
provider,
|
||||
).setApprovalForAll.sendTransactionAsync(approvedSpenderAddress, true, { from: tokenOwnerAddress }),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
expect(
|
||||
await libAssetData.getAllowance.callAsync(
|
||||
tokenOwnerAddress,
|
||||
approvedSpenderAddress,
|
||||
await libAssetData.encodeERC1155AssetData.callAsync(
|
||||
erc1155MintableAddress,
|
||||
[erc1155TokenId],
|
||||
[new BigNumber(1)],
|
||||
'0x',
|
||||
),
|
||||
),
|
||||
).to.bignumber.equal(1);
|
||||
});
|
||||
|
||||
it('should query multi-asset allowances by asset data', async () => {
|
||||
await setERC20AllowanceAsync();
|
||||
await setERC721AllowanceAsync();
|
||||
expect(
|
||||
await libAssetData.getAllowance.callAsync(
|
||||
tokenOwnerAddress,
|
||||
approvedSpenderAddress,
|
||||
await libAssetData.encodeMultiAssetData.callAsync(
|
||||
[new BigNumber(1), new BigNumber(1)],
|
||||
[
|
||||
await libAssetData.encodeERC20AssetData.callAsync(erc20TokenAddress),
|
||||
await libAssetData.encodeERC721AssetData.callAsync(erc721TokenAddress, firstERC721TokenId),
|
||||
],
|
||||
),
|
||||
),
|
||||
).to.bignumber.equal(1);
|
||||
return;
|
||||
});
|
||||
|
||||
it('should query balances for a batch of asset data strings', async () => {
|
||||
expect(
|
||||
await libAssetData.getBatchBalances.callAsync(tokenOwnerAddress, [
|
||||
await libAssetData.encodeERC20AssetData.callAsync(erc20TokenAddress),
|
||||
await libAssetData.encodeERC721AssetData.callAsync(erc721TokenAddress, firstERC721TokenId),
|
||||
]),
|
||||
).to.deep.equal([new BigNumber(erc20TokenTotalSupply), new BigNumber(1)]);
|
||||
});
|
||||
|
||||
it('should query allowances for a batch of asset data strings', async () => {
|
||||
await setERC20AllowanceAsync();
|
||||
await setERC721AllowanceAsync();
|
||||
expect(
|
||||
await libAssetData.getBatchAllowances.callAsync(tokenOwnerAddress, approvedSpenderAddress, [
|
||||
await libAssetData.encodeERC20AssetData.callAsync(erc20TokenAddress),
|
||||
await libAssetData.encodeERC721AssetData.callAsync(erc721TokenAddress, firstERC721TokenId),
|
||||
]),
|
||||
).to.deep.equal([new BigNumber(1), new BigNumber(1)]);
|
||||
});
|
||||
|
||||
describe('getERC721TokenOwner', async () => {
|
||||
it('should return the null address when tokenId is not owned', async () => {
|
||||
const nonexistentTokenId = new BigNumber(1234567890);
|
||||
expect(
|
||||
await libAssetData.getERC721TokenOwner.callAsync(erc721TokenAddress, nonexistentTokenId),
|
||||
).to.be.equal(constants.NULL_ADDRESS);
|
||||
});
|
||||
it('should return the owner address when tokenId is owned', async () => {
|
||||
expect(
|
||||
await libAssetData.getERC721TokenOwner.callAsync(erc721TokenAddress, firstERC721TokenId),
|
||||
).to.be.equal(tokenOwnerAddress);
|
||||
});
|
||||
});
|
||||
|
||||
it('should query balance and allowance together, from asset data', async () => {
|
||||
await setERC20AllowanceAsync();
|
||||
expect(
|
||||
await libAssetData.getBalanceAndAllowance.callAsync(
|
||||
tokenOwnerAddress,
|
||||
approvedSpenderAddress,
|
||||
await libAssetData.encodeERC20AssetData.callAsync(erc20TokenAddress),
|
||||
),
|
||||
).to.deep.equal([new BigNumber(erc20TokenTotalSupply), new BigNumber(1)]);
|
||||
});
|
||||
|
||||
it('should query balances and allowances together, from an asset data array', async () => {
|
||||
await setERC20AllowanceAsync();
|
||||
expect(
|
||||
await libAssetData.getBatchBalancesAndAllowances.callAsync(tokenOwnerAddress, approvedSpenderAddress, [
|
||||
await libAssetData.encodeERC20AssetData.callAsync(erc20TokenAddress),
|
||||
]),
|
||||
).to.deep.equal([[new BigNumber(erc20TokenTotalSupply)], [new BigNumber(1)]]);
|
||||
});
|
||||
});
|
@@ -111,72 +111,62 @@ describe('Asset Transfer Proxies', () => {
|
||||
);
|
||||
|
||||
// Configure ERC20Proxy
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(authorized, {
|
||||
from: owner,
|
||||
}),
|
||||
await erc20Proxy.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
authorized,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, {
|
||||
from: owner,
|
||||
}),
|
||||
await erc20Proxy.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
multiAssetProxy.address,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
|
||||
// Configure ERC721Proxy
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(authorized, {
|
||||
from: owner,
|
||||
}),
|
||||
await erc721Proxy.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
authorized,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, {
|
||||
from: owner,
|
||||
}),
|
||||
await erc721Proxy.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
multiAssetProxy.address,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
|
||||
// Configure ERC115Proxy
|
||||
erc1155ProxyWrapper = new ERC1155ProxyWrapper(provider, usedAddresses, owner);
|
||||
erc1155Proxy = await erc1155ProxyWrapper.deployProxyAsync();
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc1155Proxy.addAuthorizedAddress.sendTransactionAsync(authorized, {
|
||||
from: owner,
|
||||
}),
|
||||
await erc1155Proxy.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
authorized,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc1155Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, {
|
||||
from: owner,
|
||||
}),
|
||||
await erc1155Proxy.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
multiAssetProxy.address,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
|
||||
// Configure MultiAssetProxy
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await multiAssetProxy.addAuthorizedAddress.sendTransactionAsync(authorized, {
|
||||
from: owner,
|
||||
}),
|
||||
await multiAssetProxy.addAuthorizedAddress.awaitTransactionSuccessAsync(
|
||||
authorized,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc20Proxy.address, {
|
||||
from: owner,
|
||||
}),
|
||||
await multiAssetProxy.registerAssetProxy.awaitTransactionSuccessAsync(
|
||||
erc20Proxy.address,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc721Proxy.address, {
|
||||
from: owner,
|
||||
}),
|
||||
await multiAssetProxy.registerAssetProxy.awaitTransactionSuccessAsync(
|
||||
erc721Proxy.address,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc1155Proxy.address, {
|
||||
from: owner,
|
||||
}),
|
||||
await multiAssetProxy.registerAssetProxy.awaitTransactionSuccessAsync(
|
||||
erc1155Proxy.address,
|
||||
{ from: owner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
|
||||
@@ -206,31 +196,26 @@ describe('Asset Transfer Proxies', () => {
|
||||
);
|
||||
|
||||
await erc20Wrapper.setBalancesAndAllowancesAsync();
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await noReturnErc20Token.setBalance.sendTransactionAsync(fromAddress, constants.INITIAL_ERC20_BALANCE),
|
||||
await noReturnErc20Token.setBalance.awaitTransactionSuccessAsync(
|
||||
fromAddress,
|
||||
constants.INITIAL_ERC20_BALANCE,
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await noReturnErc20Token.approve.sendTransactionAsync(
|
||||
erc20Proxy.address,
|
||||
constants.INITIAL_ERC20_ALLOWANCE,
|
||||
{ from: fromAddress },
|
||||
),
|
||||
await noReturnErc20Token.approve.awaitTransactionSuccessAsync(
|
||||
erc20Proxy.address,
|
||||
constants.INITIAL_ERC20_ALLOWANCE,
|
||||
{ from: fromAddress },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await multipleReturnErc20Token.setBalance.sendTransactionAsync(
|
||||
fromAddress,
|
||||
constants.INITIAL_ERC20_BALANCE,
|
||||
),
|
||||
await multipleReturnErc20Token.setBalance.awaitTransactionSuccessAsync(
|
||||
fromAddress,
|
||||
constants.INITIAL_ERC20_BALANCE,
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await multipleReturnErc20Token.approve.sendTransactionAsync(
|
||||
erc20Proxy.address,
|
||||
constants.INITIAL_ERC20_ALLOWANCE,
|
||||
{ from: fromAddress },
|
||||
),
|
||||
await multipleReturnErc20Token.approve.awaitTransactionSuccessAsync(
|
||||
erc20Proxy.address,
|
||||
constants.INITIAL_ERC20_ALLOWANCE,
|
||||
{ from: fromAddress },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
|
||||
@@ -419,10 +404,10 @@ describe('Asset Transfer Proxies', () => {
|
||||
toAddress,
|
||||
amount,
|
||||
);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc20TokenA.approve.sendTransactionAsync(erc20Proxy.address, allowance, {
|
||||
from: fromAddress,
|
||||
}),
|
||||
await erc20TokenA.approve.awaitTransactionSuccessAsync(
|
||||
erc20Proxy.address,
|
||||
allowance,
|
||||
{ from: fromAddress },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
const erc20Balances = await erc20Wrapper.getBalancesAsync();
|
||||
@@ -451,10 +436,10 @@ describe('Asset Transfer Proxies', () => {
|
||||
toAddress,
|
||||
amount,
|
||||
);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await noReturnErc20Token.approve.sendTransactionAsync(erc20Proxy.address, allowance, {
|
||||
from: fromAddress,
|
||||
}),
|
||||
await noReturnErc20Token.approve.awaitTransactionSuccessAsync(
|
||||
erc20Proxy.address,
|
||||
allowance,
|
||||
{ from: fromAddress },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
const initialFromBalance = await noReturnErc20Token.balanceOf.callAsync(fromAddress);
|
||||
@@ -692,10 +677,10 @@ describe('Asset Transfer Proxies', () => {
|
||||
const ownerFromAsset = await erc721TokenA.ownerOf.callAsync(erc721AFromTokenId);
|
||||
expect(ownerFromAsset).to.be.equal(fromAddress);
|
||||
// Remove transfer approval for fromAddress.
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc721TokenA.approve.sendTransactionAsync(constants.NULL_ADDRESS, erc721AFromTokenId, {
|
||||
from: fromAddress,
|
||||
}),
|
||||
await erc721TokenA.approve.awaitTransactionSuccessAsync(
|
||||
constants.NULL_ADDRESS,
|
||||
erc721AFromTokenId,
|
||||
{ from: fromAddress },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
// Perform a transfer; expect this to fail.
|
||||
|
@@ -2,7 +2,6 @@ import { artifacts as erc20Artifacts, DummyERC20TokenContract } from '@0x/contra
|
||||
import { constants, ERC20BalancesByOwner, txDefaults } from '@0x/contracts-test-utils';
|
||||
import { assetDataUtils } from '@0x/order-utils';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { ZeroExProvider } from 'ethereum-types';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
@@ -11,7 +10,6 @@ import { artifacts, ERC20ProxyContract } from '../../src';
|
||||
export class ERC20Wrapper {
|
||||
private readonly _tokenOwnerAddresses: string[];
|
||||
private readonly _contractOwnerAddress: string;
|
||||
private readonly _web3Wrapper: Web3Wrapper;
|
||||
private readonly _provider: ZeroExProvider;
|
||||
private readonly _dummyTokenContracts: DummyERC20TokenContract[];
|
||||
private _proxyContract?: ERC20ProxyContract;
|
||||
@@ -25,7 +23,6 @@ export class ERC20Wrapper {
|
||||
*/
|
||||
constructor(provider: ZeroExProvider, tokenOwnerAddresses: string[], contractOwnerAddress: string) {
|
||||
this._dummyTokenContracts = [];
|
||||
this._web3Wrapper = new Web3Wrapper(provider);
|
||||
this._provider = provider;
|
||||
this._tokenOwnerAddresses = tokenOwnerAddresses;
|
||||
this._contractOwnerAddress = contractOwnerAddress;
|
||||
@@ -67,20 +64,16 @@ export class ERC20Wrapper {
|
||||
this._validateProxyContractExistsOrThrow();
|
||||
for (const dummyTokenContract of this._dummyTokenContracts) {
|
||||
for (const tokenOwnerAddress of this._tokenOwnerAddresses) {
|
||||
await this._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await dummyTokenContract.setBalance.sendTransactionAsync(
|
||||
tokenOwnerAddress,
|
||||
constants.INITIAL_ERC20_BALANCE,
|
||||
{ from: this._contractOwnerAddress },
|
||||
),
|
||||
await dummyTokenContract.setBalance.awaitTransactionSuccessAsync(
|
||||
tokenOwnerAddress,
|
||||
constants.INITIAL_ERC20_BALANCE,
|
||||
{ from: this._contractOwnerAddress },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
await this._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await dummyTokenContract.approve.sendTransactionAsync(
|
||||
(this._proxyContract as ERC20ProxyContract).address,
|
||||
constants.INITIAL_ERC20_ALLOWANCE,
|
||||
{ from: tokenOwnerAddress },
|
||||
),
|
||||
await dummyTokenContract.approve.awaitTransactionSuccessAsync(
|
||||
(this._proxyContract as ERC20ProxyContract).address,
|
||||
constants.INITIAL_ERC20_ALLOWANCE,
|
||||
{ from: tokenOwnerAddress },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
}
|
||||
@@ -93,10 +86,10 @@ export class ERC20Wrapper {
|
||||
}
|
||||
public async setBalanceAsync(userAddress: string, assetData: string, amount: BigNumber): Promise<void> {
|
||||
const tokenContract = this._getTokenContractFromAssetData(assetData);
|
||||
await this._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await tokenContract.setBalance.sendTransactionAsync(userAddress, amount, {
|
||||
from: this._contractOwnerAddress,
|
||||
}),
|
||||
await tokenContract.setBalance.awaitTransactionSuccessAsync(
|
||||
userAddress,
|
||||
amount,
|
||||
{ from: this._contractOwnerAddress },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
}
|
||||
@@ -109,10 +102,10 @@ export class ERC20Wrapper {
|
||||
public async setAllowanceAsync(userAddress: string, assetData: string, amount: BigNumber): Promise<void> {
|
||||
const tokenContract = this._getTokenContractFromAssetData(assetData);
|
||||
const proxyAddress = (this._proxyContract as ERC20ProxyContract).address;
|
||||
await this._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await tokenContract.approve.sendTransactionAsync(proxyAddress, amount, {
|
||||
from: userAddress,
|
||||
}),
|
||||
await tokenContract.approve.awaitTransactionSuccessAsync(
|
||||
proxyAddress,
|
||||
amount,
|
||||
{ from: userAddress },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
}
|
||||
|
@@ -2,7 +2,6 @@ import { artifacts as erc721Artifacts, DummyERC721TokenContract } from '@0x/cont
|
||||
import { constants, ERC721TokenIdsByOwner, txDefaults } from '@0x/contracts-test-utils';
|
||||
import { generatePseudoRandomSalt } from '@0x/order-utils';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { ZeroExProvider } from 'ethereum-types';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
@@ -11,14 +10,12 @@ import { artifacts, ERC721ProxyContract } from '../../src';
|
||||
export class ERC721Wrapper {
|
||||
private readonly _tokenOwnerAddresses: string[];
|
||||
private readonly _contractOwnerAddress: string;
|
||||
private readonly _web3Wrapper: Web3Wrapper;
|
||||
private readonly _provider: ZeroExProvider;
|
||||
private readonly _dummyTokenContracts: DummyERC721TokenContract[];
|
||||
private _proxyContract?: ERC721ProxyContract;
|
||||
private _proxyIdIfExists?: string;
|
||||
private _initialTokenIdsByOwner: ERC721TokenIdsByOwner = {};
|
||||
constructor(provider: ZeroExProvider, tokenOwnerAddresses: string[], contractOwnerAddress: string) {
|
||||
this._web3Wrapper = new Web3Wrapper(provider);
|
||||
this._provider = provider;
|
||||
this._dummyTokenContracts = [];
|
||||
this._tokenOwnerAddresses = tokenOwnerAddresses;
|
||||
@@ -91,20 +88,20 @@ export class ERC721Wrapper {
|
||||
const tokenContract = this._getTokenContractFromAssetData(tokenAddress);
|
||||
const tokenOwner = await this.ownerOfAsync(tokenAddress, tokenId);
|
||||
const proxyAddress = (this._proxyContract as ERC721ProxyContract).address;
|
||||
await this._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await tokenContract.setApprovalForAll.sendTransactionAsync(proxyAddress, isApproved, {
|
||||
from: tokenOwner,
|
||||
}),
|
||||
await tokenContract.setApprovalForAll.awaitTransactionSuccessAsync(
|
||||
proxyAddress,
|
||||
isApproved,
|
||||
{ from: tokenOwner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
}
|
||||
public async approveAsync(to: string, tokenAddress: string, tokenId: BigNumber): Promise<void> {
|
||||
const tokenContract = this._getTokenContractFromAssetData(tokenAddress);
|
||||
const tokenOwner = await this.ownerOfAsync(tokenAddress, tokenId);
|
||||
await this._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await tokenContract.approve.sendTransactionAsync(to, tokenId, {
|
||||
from: tokenOwner,
|
||||
}),
|
||||
await tokenContract.approve.awaitTransactionSuccessAsync(
|
||||
to,
|
||||
tokenId,
|
||||
{ from: tokenOwner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
}
|
||||
@@ -115,28 +112,29 @@ export class ERC721Wrapper {
|
||||
userAddress: string,
|
||||
): Promise<void> {
|
||||
const tokenContract = this._getTokenContractFromAssetData(tokenAddress);
|
||||
await this._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await tokenContract.transferFrom.sendTransactionAsync(currentOwner, userAddress, tokenId, {
|
||||
from: currentOwner,
|
||||
}),
|
||||
await tokenContract.transferFrom.awaitTransactionSuccessAsync(
|
||||
currentOwner,
|
||||
userAddress,
|
||||
tokenId,
|
||||
{ from: currentOwner },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
}
|
||||
public async mintAsync(tokenAddress: string, tokenId: BigNumber, userAddress: string): Promise<void> {
|
||||
const tokenContract = this._getTokenContractFromAssetData(tokenAddress);
|
||||
await this._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await tokenContract.mint.sendTransactionAsync(userAddress, tokenId, {
|
||||
from: this._contractOwnerAddress,
|
||||
}),
|
||||
await tokenContract.mint.awaitTransactionSuccessAsync(
|
||||
userAddress,
|
||||
tokenId,
|
||||
{ from: this._contractOwnerAddress },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
}
|
||||
public async burnAsync(tokenAddress: string, tokenId: BigNumber, owner: string): Promise<void> {
|
||||
const tokenContract = this._getTokenContractFromAssetData(tokenAddress);
|
||||
await this._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await tokenContract.burn.sendTransactionAsync(owner, tokenId, {
|
||||
from: this._contractOwnerAddress,
|
||||
}),
|
||||
await tokenContract.burn.awaitTransactionSuccessAsync(
|
||||
owner,
|
||||
tokenId,
|
||||
{ from: this._contractOwnerAddress },
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@
|
||||
"generated-artifacts/IAssetData.json",
|
||||
"generated-artifacts/IAssetProxy.json",
|
||||
"generated-artifacts/IAuthorizable.json",
|
||||
"generated-artifacts/LibAssetData.json",
|
||||
"generated-artifacts/MixinAuthorizable.json",
|
||||
"generated-artifacts/MultiAssetProxy.json"
|
||||
],
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "2.0.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557799313,
|
||||
"version": "2.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "2.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.3 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.2 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.1 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.0 - _April 11, 2019_
|
||||
|
||||
* Make `decodeOrdersFromFillData`, `getCoordinatorApprovalHash`, and `getTransactionHash` public (#1729)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"artifactsDir": "./generated-artifacts",
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": true,
|
||||
"useDockerisedSolc": false,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "constantinople",
|
||||
"optimizer": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-coordinator",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.3",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.9",
|
||||
"@0x/contracts-gen": "^1.0.8",
|
||||
"@0x/contracts-test-utils": "^3.1.2",
|
||||
"@0x/dev-utils": "^2.2.1",
|
||||
"@0x/sol-compiler": "^3.1.6",
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.6",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -68,17 +68,17 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.0.5",
|
||||
"@0x/contracts-asset-proxy": "^2.1.1",
|
||||
"@0x/contracts-erc20": "^2.2.0",
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-asset-proxy": "^2.1.4",
|
||||
"@0x/contracts-erc20": "^2.2.4",
|
||||
"@0x/contracts-exchange": "1.0.2",
|
||||
"@0x/contracts-exchange-libs": "^2.1.1",
|
||||
"@0x/contracts-utils": "^3.1.1",
|
||||
"@0x/order-utils": "^7.2.0",
|
||||
"@0x/contracts-exchange-libs": "^2.1.5",
|
||||
"@0x/contracts-utils": "^3.1.5",
|
||||
"@0x/order-utils": "^8.1.0",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.1",
|
||||
"@0x/web3-wrapper": "^6.0.5",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@0x/web3-wrapper": "^6.0.6",
|
||||
"ethereum-types": "^2.1.2",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.11"
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "1.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
],
|
||||
"timestamp": 1557799313
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "1.1.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.1.1",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.1.5 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.4 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.2 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.1 - _April 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"artifactsDir": "generated-artifacts",
|
||||
"contractsDir": "contracts",
|
||||
"useDockerisedSolc": true,
|
||||
"useDockerisedSolc": false,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "constantinople",
|
||||
"optimizer": { "enabled": true, "runs": 1000000 },
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc1155",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,10 +47,10 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.9",
|
||||
"@0x/contracts-gen": "^1.0.8",
|
||||
"@0x/dev-utils": "^2.2.1",
|
||||
"@0x/sol-compiler": "^3.1.6",
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -67,13 +67,13 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.0.5",
|
||||
"@0x/contracts-test-utils": "^3.1.2",
|
||||
"@0x/contracts-utils": "^3.1.1",
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-test-utils": "^3.1.6",
|
||||
"@0x/contracts-utils": "^3.1.5",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.1",
|
||||
"@0x/web3-wrapper": "^6.0.5",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@0x/web3-wrapper": "^6.0.6",
|
||||
"ethereum-types": "^2.1.2",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "2.2.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.2.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
],
|
||||
"timestamp": 1557799313
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "2.2.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.2.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.2.4 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.3 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.1 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.0 - _April 11, 2019_
|
||||
|
||||
* Added UntransferrableDummyERC20Token (#1714)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"artifactsDir": "./generated-artifacts",
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": true,
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "constantinople",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc20",
|
||||
"version": "2.2.0",
|
||||
"version": "2.2.4",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.9",
|
||||
"@0x/contracts-gen": "^1.0.8",
|
||||
"@0x/contracts-test-utils": "^3.1.2",
|
||||
"@0x/dev-utils": "^2.2.1",
|
||||
"@0x/sol-compiler": "^3.1.6",
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.6",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -68,13 +68,13 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.0.5",
|
||||
"@0x/contracts-exchange-libs": "^2.1.1",
|
||||
"@0x/contracts-utils": "^3.1.1",
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-exchange-libs": "^2.1.5",
|
||||
"@0x/contracts-utils": "^3.1.5",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.1",
|
||||
"@0x/web3-wrapper": "^6.0.5",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@0x/web3-wrapper": "^6.0.6",
|
||||
"ethereum-types": "^2.1.2",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "2.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
],
|
||||
"timestamp": 1557799313
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "2.1.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.1",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.5 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.4 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.2 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.1 - _April 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"artifactsDir": "./generated-artifacts",
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": true,
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "constantinople",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc721",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.9",
|
||||
"@0x/contracts-gen": "^1.0.8",
|
||||
"@0x/contracts-test-utils": "^3.1.2",
|
||||
"@0x/dev-utils": "^2.2.1",
|
||||
"@0x/sol-compiler": "^3.1.6",
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.6",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -68,12 +68,12 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.0.5",
|
||||
"@0x/contracts-utils": "^3.1.1",
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-utils": "^3.1.5",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.1",
|
||||
"@0x/web3-wrapper": "^6.0.5",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@0x/web3-wrapper": "^6.0.6",
|
||||
"ethereum-types": "^2.1.2",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -1,4 +1,32 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "3.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557799313,
|
||||
"version": "3.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Update contracts to solidity ^0.5.5 and unpin dependencies",
|
||||
"pr": 1796
|
||||
}
|
||||
],
|
||||
"timestamp": 1557507213
|
||||
},
|
||||
{
|
||||
"version": "2.1.1",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.2 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.1 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.0 - _May 10, 2019_
|
||||
|
||||
* Update contracts to solidity ^0.5.5 and unpin dependencies (#1796)
|
||||
|
||||
## v2.1.1 - _April 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"artifactsDir": "./generated-artifacts",
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": true,
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "constantinople",
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity 0.4.24;
|
||||
pragma solidity ^0.5.5;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "./MixinWeth.sol";
|
||||
@@ -40,6 +40,7 @@ contract Forwarder is
|
||||
bytes memory _wethAssetData
|
||||
)
|
||||
public
|
||||
Ownable()
|
||||
LibConstants(
|
||||
_exchange,
|
||||
_zrxAssetData,
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity ^0.5.5;
|
||||
|
||||
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
|
||||
import "@0x/contracts-utils/contracts/src/Ownable.sol";
|
||||
@@ -35,13 +35,13 @@ contract MixinAssets is
|
||||
|
||||
bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256("transfer(address,uint256)"));
|
||||
|
||||
/// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to
|
||||
/// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to
|
||||
/// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be
|
||||
/// used to withdraw assets that were accidentally sent to this contract.
|
||||
/// @param assetData Byte array encoded for the respective asset proxy.
|
||||
/// @param amount Amount of ERC20 token to withdraw.
|
||||
function withdrawAsset(
|
||||
bytes assetData,
|
||||
bytes calldata assetData,
|
||||
uint256 amount
|
||||
)
|
||||
external
|
||||
@@ -84,7 +84,7 @@ contract MixinAssets is
|
||||
// Transfer tokens.
|
||||
// We do a raw call so we can check the success separate
|
||||
// from the return data.
|
||||
bool success = token.call(abi.encodeWithSelector(
|
||||
(bool success,) = token.call(abi.encodeWithSelector(
|
||||
ERC20_TRANSFER_SELECTOR,
|
||||
msg.sender,
|
||||
amount
|
||||
@@ -93,7 +93,7 @@ contract MixinAssets is
|
||||
success,
|
||||
"TRANSFER_FAILED"
|
||||
);
|
||||
|
||||
|
||||
// Check return data.
|
||||
// If there is no return data, we assume the token incorrectly
|
||||
// does not return a bool. In this case we expect it to revert
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity ^0.5.5;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "./libs/LibConstants.sol";
|
||||
@@ -144,6 +144,7 @@ contract MixinExchangeWrapper is
|
||||
bytes memory wethAssetData = WETH_ASSET_DATA;
|
||||
|
||||
uint256 ordersLength = orders.length;
|
||||
uint256 makerAssetFilledAmount = 0;
|
||||
for (uint256 i = 0; i != ordersLength; i++) {
|
||||
|
||||
// We assume that asset being bought by taker is the same for each order.
|
||||
@@ -175,7 +176,7 @@ contract MixinExchangeWrapper is
|
||||
addFillResults(totalFillResults, singleFillResults);
|
||||
|
||||
// Stop execution if the entire amount of makerAsset has been bought
|
||||
uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;
|
||||
makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;
|
||||
if (makerAssetFilledAmount >= makerAssetFillAmount) {
|
||||
break;
|
||||
}
|
||||
@@ -192,7 +193,7 @@ contract MixinExchangeWrapper is
|
||||
/// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).
|
||||
/// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX
|
||||
/// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.
|
||||
/// The asset being sold by taker must always be WETH.
|
||||
/// The asset being sold by taker must always be WETH.
|
||||
/// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.
|
||||
/// @param zrxBuyAmount Desired amount of ZRX to buy.
|
||||
/// @param signatures Proofs that orders have been created by makers.
|
||||
@@ -230,7 +231,7 @@ contract MixinExchangeWrapper is
|
||||
// of the Maker. In this case we want to overestimate the amount of takerAsset.
|
||||
uint256 remainingWethSellAmount = getPartialAmountCeil(
|
||||
orders[i].takerAssetAmount,
|
||||
safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees
|
||||
safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees
|
||||
remainingZrxBuyAmount
|
||||
);
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity ^0.5.5;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "./libs/LibConstants.sol";
|
||||
@@ -58,7 +58,7 @@ contract MixinForwarderCore is
|
||||
/// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.
|
||||
/// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).
|
||||
/// Any ETH not spent will be refunded to sender.
|
||||
/// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset.
|
||||
/// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset.
|
||||
/// @param signatures Proofs that orders have been created by makers.
|
||||
/// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.
|
||||
/// @param feeSignatures Proofs that feeOrders have been created by makers.
|
||||
@@ -70,8 +70,8 @@ contract MixinForwarderCore is
|
||||
bytes[] memory signatures,
|
||||
LibOrder.Order[] memory feeOrders,
|
||||
bytes[] memory feeSignatures,
|
||||
uint256 feePercentage,
|
||||
address feeRecipient
|
||||
uint256 feePercentage,
|
||||
address payable feeRecipient
|
||||
)
|
||||
public
|
||||
payable
|
||||
@@ -142,7 +142,7 @@ contract MixinForwarderCore is
|
||||
/// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.
|
||||
/// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.
|
||||
/// Any ETH not spent will be refunded to sender.
|
||||
/// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset.
|
||||
/// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset.
|
||||
/// @param makerAssetFillAmount Desired amount of makerAsset to purchase.
|
||||
/// @param signatures Proofs that orders have been created by makers.
|
||||
/// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.
|
||||
@@ -156,8 +156,8 @@ contract MixinForwarderCore is
|
||||
bytes[] memory signatures,
|
||||
LibOrder.Order[] memory feeOrders,
|
||||
bytes[] memory feeSignatures,
|
||||
uint256 feePercentage,
|
||||
address feeRecipient
|
||||
uint256 feePercentage,
|
||||
address payable feeRecipient
|
||||
)
|
||||
public
|
||||
payable
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity ^0.5.5;
|
||||
|
||||
import "@0x/contracts-exchange-libs/contracts/src/LibMath.sol";
|
||||
import "./libs/LibConstants.sol";
|
||||
@@ -30,7 +30,7 @@ contract MixinWeth is
|
||||
{
|
||||
/// @dev Default payabale function, this allows us to withdraw WETH
|
||||
function ()
|
||||
public
|
||||
external
|
||||
payable
|
||||
{
|
||||
require(
|
||||
@@ -60,7 +60,7 @@ contract MixinWeth is
|
||||
uint256 wethSoldExcludingFeeOrders,
|
||||
uint256 wethSoldForZrx,
|
||||
uint256 feePercentage,
|
||||
address feeRecipient
|
||||
address payable feeRecipient
|
||||
)
|
||||
internal
|
||||
{
|
||||
@@ -92,7 +92,7 @@ contract MixinWeth is
|
||||
ethFee <= wethRemaining,
|
||||
"INSUFFICIENT_ETH_REMAINING"
|
||||
);
|
||||
|
||||
|
||||
// Do nothing if no WETH remaining
|
||||
if (wethRemaining > 0) {
|
||||
// Convert remaining WETH to ETH
|
||||
|
@@ -16,18 +16,18 @@
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity ^0.5.5;
|
||||
|
||||
|
||||
contract IAssets {
|
||||
|
||||
/// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to
|
||||
/// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to
|
||||
/// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be
|
||||
/// used to withdraw assets that were accidentally sent to this contract.
|
||||
/// @param assetData Byte array encoded for the respective asset proxy.
|
||||
/// @param amount Amount of ERC20 token to withdraw.
|
||||
function withdrawAsset(
|
||||
bytes assetData,
|
||||
bytes calldata assetData,
|
||||
uint256 amount
|
||||
)
|
||||
external;
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity ^0.5.5;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "./IForwarderCore.sol";
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity ^0.5.5;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";
|
||||
@@ -29,7 +29,7 @@ contract IForwarderCore {
|
||||
/// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.
|
||||
/// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).
|
||||
/// Any ETH not spent will be refunded to sender.
|
||||
/// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset.
|
||||
/// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset.
|
||||
/// @param signatures Proofs that orders have been created by makers.
|
||||
/// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.
|
||||
/// @param feeSignatures Proofs that feeOrders have been created by makers.
|
||||
@@ -41,8 +41,8 @@ contract IForwarderCore {
|
||||
bytes[] memory signatures,
|
||||
LibOrder.Order[] memory feeOrders,
|
||||
bytes[] memory feeSignatures,
|
||||
uint256 feePercentage,
|
||||
address feeRecipient
|
||||
uint256 feePercentage,
|
||||
address payable feeRecipient
|
||||
)
|
||||
public
|
||||
payable
|
||||
@@ -54,7 +54,7 @@ contract IForwarderCore {
|
||||
/// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.
|
||||
/// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.
|
||||
/// Any ETH not spent will be refunded to sender.
|
||||
/// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset.
|
||||
/// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset.
|
||||
/// @param makerAssetFillAmount Desired amount of makerAsset to purchase.
|
||||
/// @param signatures Proofs that orders have been created by makers.
|
||||
/// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.
|
||||
@@ -68,8 +68,8 @@ contract IForwarderCore {
|
||||
bytes[] memory signatures,
|
||||
LibOrder.Order[] memory feeOrders,
|
||||
bytes[] memory feeSignatures,
|
||||
uint256 feePercentage,
|
||||
address feeRecipient
|
||||
uint256 feePercentage,
|
||||
address payable feeRecipient
|
||||
)
|
||||
public
|
||||
payable
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity ^0.5.5;
|
||||
|
||||
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
|
||||
import "@0x/contracts-exchange/contracts/src/interfaces/IExchange.sol";
|
||||
@@ -31,10 +31,10 @@ contract LibConstants {
|
||||
bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256("ERC20Token(address)"));
|
||||
bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256("ERC721Token(address,uint256)"));
|
||||
uint256 constant internal MAX_UINT = 2**256 - 1;
|
||||
uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18;
|
||||
uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18;
|
||||
uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%
|
||||
uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%
|
||||
|
||||
|
||||
// solhint-disable var-name-mixedcase
|
||||
IExchange internal EXCHANGE;
|
||||
IEtherToken internal ETHER_TOKEN;
|
||||
|
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
// solhint-disable
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity ^0.5.5;
|
||||
|
||||
|
||||
/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity ^0.5.5;
|
||||
|
||||
import "../interfaces/IAssets.sol";
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity ^0.5.5;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";
|
||||
@@ -72,7 +72,7 @@ contract MExchangeWrapper {
|
||||
/// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).
|
||||
/// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX
|
||||
/// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.
|
||||
/// The asset being sold by taker must always be WETH.
|
||||
/// The asset being sold by taker must always be WETH.
|
||||
/// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.
|
||||
/// @param zrxBuyAmount Desired amount of ZRX to buy.
|
||||
/// @param signatures Proofs that orders have been created by makers.
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity ^0.5.5;
|
||||
|
||||
|
||||
contract MWeth {
|
||||
@@ -35,7 +35,7 @@ contract MWeth {
|
||||
uint256 wethSoldExcludingFeeOrders,
|
||||
uint256 wethSoldForZrx,
|
||||
uint256 feePercentage,
|
||||
address feeRecipient
|
||||
address payable feeRecipient
|
||||
)
|
||||
internal;
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange-forwarder",
|
||||
"version": "2.1.1",
|
||||
"version": "3.0.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -24,7 +24,6 @@
|
||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"coverage:report:text": "istanbul report text",
|
||||
"coverage:report:html": "istanbul report html && open coverage/index.html",
|
||||
"profiler:report:html": "istanbul report html && open coverage/index.html",
|
||||
@@ -47,12 +46,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.9",
|
||||
"@0x/contract-wrappers": "^9.0.0",
|
||||
"@0x/contracts-gen": "^1.0.8",
|
||||
"@0x/contracts-test-utils": "^3.1.2",
|
||||
"@0x/dev-utils": "^2.2.1",
|
||||
"@0x/sol-compiler": "^3.1.6",
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contract-wrappers": "^9.1.3",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.6",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -69,18 +68,18 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.0.5",
|
||||
"@0x/contracts-asset-proxy": "^2.1.1",
|
||||
"@0x/contracts-erc20": "1.0.8",
|
||||
"@0x/contracts-erc721": "1.0.8",
|
||||
"@0x/contracts-exchange": "1.0.2",
|
||||
"@0x/contracts-exchange-libs": "1.0.2",
|
||||
"@0x/contracts-utils": "2.0.1",
|
||||
"@0x/order-utils": "^7.2.0",
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-asset-proxy": "^2.1.4",
|
||||
"@0x/contracts-erc20": "^2.2.4",
|
||||
"@0x/contracts-erc721": "^2.1.5",
|
||||
"@0x/contracts-exchange": "^2.1.4",
|
||||
"@0x/contracts-exchange-libs": "^2.1.5",
|
||||
"@0x/contracts-utils": "^3.1.5",
|
||||
"@0x/order-utils": "^8.1.0",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.1",
|
||||
"@0x/web3-wrapper": "^6.0.5",
|
||||
"@0x/typescript-typings": "^4.2.1",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@0x/web3-wrapper": "^6.0.6",
|
||||
"ethereum-types": "^2.1.2",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "2.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
],
|
||||
"timestamp": 1557799313
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "2.1.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.1",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.5 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.4 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.2 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.1 - _April 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"artifactsDir": "./generated-artifacts",
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": true,
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "constantinople",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange-libs",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/libs/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.9",
|
||||
"@0x/contracts-gen": "^1.0.8",
|
||||
"@0x/contracts-test-utils": "^3.1.2",
|
||||
"@0x/dev-utils": "^2.2.1",
|
||||
"@0x/sol-compiler": "^3.1.6",
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.6",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -68,13 +68,13 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.0.5",
|
||||
"@0x/contracts-utils": "^3.1.1",
|
||||
"@0x/order-utils": "^7.2.0",
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-utils": "^3.1.5",
|
||||
"@0x/order-utils": "^8.1.0",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.1",
|
||||
"@0x/web3-wrapper": "^6.0.5",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@0x/web3-wrapper": "^6.0.6",
|
||||
"ethereum-types": "^2.1.2",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "2.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557799313,
|
||||
"version": "2.1.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "2.1.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.1",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.4 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.3 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.2 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.1 - _April 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"artifactsDir": "./generated-artifacts",
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": true,
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "constantinople",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.4",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.9",
|
||||
"@0x/contracts-gen": "^1.0.8",
|
||||
"@0x/contracts-test-utils": "^3.1.2",
|
||||
"@0x/dev-utils": "^2.2.1",
|
||||
"@0x/sol-compiler": "^3.1.6",
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.6",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -68,18 +68,18 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.0.5",
|
||||
"@0x/contracts-asset-proxy": "^2.1.1",
|
||||
"@0x/contracts-erc1155": "^1.1.1",
|
||||
"@0x/contracts-erc20": "^2.2.0",
|
||||
"@0x/contracts-erc721": "^2.1.1",
|
||||
"@0x/contracts-exchange-libs": "^2.1.1",
|
||||
"@0x/contracts-utils": "^3.1.1",
|
||||
"@0x/order-utils": "^7.2.0",
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-asset-proxy": "^2.1.4",
|
||||
"@0x/contracts-erc1155": "^1.1.5",
|
||||
"@0x/contracts-erc20": "^2.2.4",
|
||||
"@0x/contracts-erc721": "^2.1.5",
|
||||
"@0x/contracts-exchange-libs": "^2.1.5",
|
||||
"@0x/contracts-utils": "^3.1.5",
|
||||
"@0x/order-utils": "^8.1.0",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.1",
|
||||
"@0x/web3-wrapper": "^6.0.5",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@0x/web3-wrapper": "^6.0.6",
|
||||
"ethereum-types": "^2.1.2",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.11"
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "3.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557799313,
|
||||
"version": "3.1.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "3.1.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.1.1",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.4 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.3 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.2 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.1 - _April 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"artifactsDir": "./generated-artifacts",
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": true,
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "constantinople",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-extensions",
|
||||
"version": "3.1.1",
|
||||
"version": "3.1.4",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,12 +47,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.9",
|
||||
"@0x/contract-wrappers": "^9.0.0",
|
||||
"@0x/contracts-gen": "^1.0.8",
|
||||
"@0x/contracts-test-utils": "^3.1.2",
|
||||
"@0x/dev-utils": "^2.2.1",
|
||||
"@0x/sol-compiler": "^3.1.6",
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contract-wrappers": "^9.1.3",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.6",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -69,18 +69,18 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.0.5",
|
||||
"@0x/contracts-asset-proxy": "^2.1.1",
|
||||
"@0x/contracts-erc20": "^2.2.0",
|
||||
"@0x/contracts-erc721": "^2.1.1",
|
||||
"@0x/contracts-exchange": "^2.1.1",
|
||||
"@0x/contracts-exchange-libs": "^2.1.1",
|
||||
"@0x/contracts-utils": "^3.1.1",
|
||||
"@0x/order-utils": "^7.2.0",
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-asset-proxy": "^2.1.4",
|
||||
"@0x/contracts-erc20": "^2.2.4",
|
||||
"@0x/contracts-erc721": "^2.1.5",
|
||||
"@0x/contracts-exchange": "^2.1.4",
|
||||
"@0x/contracts-exchange-libs": "^2.1.5",
|
||||
"@0x/contracts-utils": "^3.1.5",
|
||||
"@0x/order-utils": "^8.1.0",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.1",
|
||||
"@0x/web3-wrapper": "^6.0.5",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@0x/web3-wrapper": "^6.0.6",
|
||||
"ethereum-types": "^2.1.2",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "3.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557799313,
|
||||
"version": "3.1.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "3.1.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.1.1",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.4 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.3 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.2 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.1 - _April 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"artifactsDir": "./generated-artifacts",
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": true,
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "constantinople",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-multisig",
|
||||
"version": "3.1.1",
|
||||
"version": "3.1.4",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/multisig/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.9",
|
||||
"@0x/contracts-gen": "^1.0.8",
|
||||
"@0x/contracts-test-utils": "^3.1.2",
|
||||
"@0x/dev-utils": "^2.2.1",
|
||||
"@0x/sol-compiler": "^3.1.6",
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.6",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -68,14 +68,14 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.0.5",
|
||||
"@0x/contracts-asset-proxy": "^2.1.1",
|
||||
"@0x/contracts-erc20": "^2.2.0",
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-asset-proxy": "^2.1.4",
|
||||
"@0x/contracts-erc20": "^2.2.4",
|
||||
"@0x/contracts-utils": "2.0.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.1",
|
||||
"@0x/web3-wrapper": "^6.0.5",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@0x/web3-wrapper": "^6.0.6",
|
||||
"ethereum-types": "^2.1.2",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "3.1.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
],
|
||||
"timestamp": 1557799313
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "3.1.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.1.2",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.6 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.5 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.3 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.2 - _April 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-test-utils",
|
||||
"version": "3.1.2",
|
||||
"version": "3.1.6",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -41,19 +41,19 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/abi-gen": "^2.0.9",
|
||||
"@0x/dev-utils": "^2.2.1",
|
||||
"@0x/order-utils": "^7.2.0",
|
||||
"@0x/sol-compiler": "^3.1.6",
|
||||
"@0x/sol-coverage": "^3.0.3",
|
||||
"@0x/sol-profiler": "^3.1.5",
|
||||
"@0x/sol-trace": "^2.0.11",
|
||||
"@0x/subproviders": "^4.0.5",
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/order-utils": "^8.1.0",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/sol-coverage": "^3.0.4",
|
||||
"@0x/sol-profiler": "^3.1.6",
|
||||
"@0x/sol-trace": "^2.0.12",
|
||||
"@0x/subproviders": "^4.0.6",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.1",
|
||||
"@0x/web3-wrapper": "^6.0.5",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@0x/web3-wrapper": "^6.0.6",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/js-combinatorics": "^0.5.29",
|
||||
"@types/lodash": "4.14.104",
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "3.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
],
|
||||
"timestamp": 1557799313
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "3.1.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.1.1",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.5 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.4 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.2 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.1 - _April 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"artifactsDir": "./generated-artifacts",
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": true,
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "constantinople",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-utils",
|
||||
"version": "3.1.1",
|
||||
"version": "3.1.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/utils/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.9",
|
||||
"@0x/contracts-gen": "^1.0.8",
|
||||
"@0x/contracts-test-utils": "^3.1.2",
|
||||
"@0x/dev-utils": "^2.2.1",
|
||||
"@0x/sol-compiler": "^3.1.6",
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/contracts-gen": "^1.0.9",
|
||||
"@0x/contracts-test-utils": "^3.1.6",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/sol-compiler": "^3.1.7",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
@@ -69,12 +69,12 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.0.5",
|
||||
"@0x/order-utils": "^7.2.0",
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/order-utils": "^8.1.0",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.1",
|
||||
"@0x/web3-wrapper": "^6.0.5",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@0x/web3-wrapper": "^6.0.6",
|
||||
"bn.js": "^4.11.8",
|
||||
"ethereum-types": "^2.1.2",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
|
@@ -23,11 +23,6 @@ describe('LibAddressArray', () => {
|
||||
|
||||
before(async () => {
|
||||
await blockchainLifecycle.startAsync();
|
||||
});
|
||||
after(async () => {
|
||||
await blockchainLifecycle.revertAsync();
|
||||
});
|
||||
before(async () => {
|
||||
// Deploy LibAddressArray
|
||||
lib = await TestLibAddressArrayContract.deployFrom0xArtifactAsync(
|
||||
artifacts.TestLibAddressArray,
|
||||
@@ -35,10 +30,7 @@ describe('LibAddressArray', () => {
|
||||
txDefaults,
|
||||
);
|
||||
});
|
||||
beforeEach(async () => {
|
||||
await blockchainLifecycle.startAsync();
|
||||
});
|
||||
afterEach(async () => {
|
||||
after(async () => {
|
||||
await blockchainLifecycle.revertAsync();
|
||||
});
|
||||
|
||||
|
@@ -33,6 +33,7 @@
|
||||
"build:ts": "tsc -b",
|
||||
"watch:ts": "tsc -b -w",
|
||||
"clean": "wsrun clean $PKG --fast-exit -r --parallel --exclude-missing",
|
||||
"clean:contracts": "wsrun clean -p ${npm_package_config_contractsPackages} -c --fast-exit -r --parallel --exclude-missing",
|
||||
"contracts:gen": "wsrun contracts:gen $PKG --fast-exit -r --parallel --exclude-missing",
|
||||
"contracts:compile": "wsrun compile $PKG --fast-exit -r --stages --exclude-missing",
|
||||
"contracts:watch": "wsrun watch $PKG --parallel --exclude-missing",
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1557961111,
|
||||
"version": "6.0.9",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557799313,
|
||||
"version": "6.0.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1557507213,
|
||||
"version": "6.0.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "6.0.6",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v6.0.9 - _May 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v6.0.8 - _May 14, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v6.0.7 - _May 10, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v6.0.6 - _April 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "0x.js",
|
||||
"version": "6.0.6",
|
||||
"version": "6.0.9",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -43,10 +43,10 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen-wrappers": "^4.2.0",
|
||||
"@0x/contract-addresses": "^2.3.1",
|
||||
"@0x/dev-utils": "^2.2.1",
|
||||
"@0x/migrations": "^4.1.1",
|
||||
"@0x/abi-gen-wrappers": "^4.3.0",
|
||||
"@0x/contract-addresses": "^2.3.3",
|
||||
"@0x/dev-utils": "^2.2.2",
|
||||
"@0x/migrations": "^4.1.5",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^2.2.42",
|
||||
@@ -73,16 +73,16 @@
|
||||
"webpack": "^4.20.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/assert": "^2.0.9",
|
||||
"@0x/base-contract": "^5.0.5",
|
||||
"@0x/contract-wrappers": "^9.0.0",
|
||||
"@0x/order-utils": "^7.2.0",
|
||||
"@0x/order-watcher": "^4.0.6",
|
||||
"@0x/subproviders": "^4.0.5",
|
||||
"@0x/assert": "^2.0.10",
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contract-wrappers": "^9.1.3",
|
||||
"@0x/order-utils": "^8.1.0",
|
||||
"@0x/order-watcher": "^4.0.10",
|
||||
"@0x/subproviders": "^4.0.6",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
"@0x/utils": "^4.3.1",
|
||||
"@0x/web3-wrapper": "^6.0.5",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@0x/web3-wrapper": "^6.0.6",
|
||||
"@types/web3-provider-engine": "^14.0.0",
|
||||
"ethereum-types": "^2.1.2",
|
||||
"ethers": "~4.0.4",
|
||||
|
@@ -10,6 +10,9 @@ export {
|
||||
|
||||
export {
|
||||
ContractWrappers,
|
||||
CoordinatorWrapper,
|
||||
CoordinatorServerCancellationResponse,
|
||||
CoordinatorServerError,
|
||||
DutchAuctionWrapper,
|
||||
ERC20TokenWrapper,
|
||||
ERC721TokenWrapper,
|
||||
|
@@ -1,4 +1,14 @@
|
||||
[
|
||||
{
|
||||
"version": "2.1.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "add `awaitTransactionSuccessAsync()` to `tx.handlebars`",
|
||||
"pr": 1797
|
||||
}
|
||||
],
|
||||
"timestamp": 1557507213
|
||||
},
|
||||
{
|
||||
"version": "2.0.2",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.0 - _May 10, 2019_
|
||||
|
||||
* add `awaitTransactionSuccessAsync()` to `tx.handlebars` (#1797)
|
||||
|
||||
## v2.0.2 - _April 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,8 +1,20 @@
|
||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
|
||||
// tslint:disable:no-unused-variable
|
||||
// tslint:disable:no-unbound-method
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
|
||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
DecodedLogArgs,
|
||||
MethodAbi,
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/abi-gen-templates",
|
||||
"version": "2.0.2",
|
||||
"version": "2.1.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
|
@@ -25,6 +25,42 @@ public {{this.tsName}} = {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
{{> typed_params inputs=inputs}}
|
||||
{{#this.payable}}
|
||||
txData?: Partial<TxDataPayable> | number,
|
||||
{{/this.payable}}
|
||||
{{^this.payable}}
|
||||
txData?: Partial<TxData> | number,
|
||||
{{/this.payable}}
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as {{contractName}}Contract;
|
||||
{{#if inputs}}
|
||||
const txHashPromise = self.{{this.tsName}}.sendTransactionAsync({{> params input=inputs}}, txData);
|
||||
{{else}}
|
||||
const txHashPromise = self.{{this.tsName}}.sendTransactionAsync(txData);
|
||||
{{/if}}
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
{{> typed_params inputs=inputs}}
|
||||
txData: Partial<TxData> = {},
|
||||
|
@@ -1,4 +1,14 @@
|
||||
[
|
||||
{
|
||||
"version": "4.3.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Update wrapper functions to expose `awaitTransactionSuccessAsync()` methods",
|
||||
"pr": 1797
|
||||
}
|
||||
],
|
||||
"timestamp": 1557507213
|
||||
},
|
||||
{
|
||||
"version": "4.2.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.3.0 - _May 10, 2019_
|
||||
|
||||
* Update wrapper functions to expose `awaitTransactionSuccessAsync()` methods (#1797)
|
||||
|
||||
## v4.2.0 - _April 11, 2019_
|
||||
|
||||
* Added IAssetProxy wrapper (#1714)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/abi-gen-wrappers",
|
||||
"version": "4.2.0",
|
||||
"version": "4.3.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -31,19 +31,19 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen-wrappers/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.9",
|
||||
"@0x/abi-gen-templates": "^2.0.2",
|
||||
"@0x/abi-gen": "^2.0.10",
|
||||
"@0x/abi-gen-templates": "^2.1.0",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/utils": "^4.3.1",
|
||||
"@0x/web3-wrapper": "^6.0.5",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@0x/web3-wrapper": "^6.0.6",
|
||||
"ethereum-types": "^2.1.2",
|
||||
"ethers": "~4.0.4",
|
||||
"lodash": "^4.17.11",
|
||||
"shx": "^0.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.0.5"
|
||||
"@0x/base-contract": "^5.1.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,13 +1,24 @@
|
||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
|
||||
// tslint:disable:no-unused-variable
|
||||
// tslint:disable:no-unbound-method
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
|
||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
DecodedLogArgs,
|
||||
MethodAbi,
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
export type AssetProxyOwnerEventArgs =
|
||||
@@ -148,6 +159,34 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
owner: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as AssetProxyOwnerContract;
|
||||
const txHashPromise = self.removeOwner.sendTransactionAsync(owner
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
owner: string,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -224,6 +263,34 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
transactionId: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as AssetProxyOwnerContract;
|
||||
const txHashPromise = self.revokeConfirmation.sendTransactionAsync(transactionId
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
transactionId: BigNumber,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -358,6 +425,34 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
transactionId: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as AssetProxyOwnerContract;
|
||||
const txHashPromise = self.executeRemoveAuthorizedAddressAtIndex.sendTransactionAsync(transactionId
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
transactionId: BigNumber,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -493,6 +588,36 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
assetProxyContract: string,
|
||||
isRegistered: boolean,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as AssetProxyOwnerContract;
|
||||
const txHashPromise = self.registerAssetProxy.sendTransactionAsync(assetProxyContract,
|
||||
isRegistered
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
assetProxyContract: string,
|
||||
isRegistered: boolean,
|
||||
@@ -575,6 +700,34 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
owner: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as AssetProxyOwnerContract;
|
||||
const txHashPromise = self.addOwner.sendTransactionAsync(owner
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
owner: string,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -679,6 +832,34 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_secondsTimeLocked: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as AssetProxyOwnerContract;
|
||||
const txHashPromise = self.changeTimeLock.sendTransactionAsync(_secondsTimeLocked
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_secondsTimeLocked: BigNumber,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -953,6 +1134,34 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_required: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as AssetProxyOwnerContract;
|
||||
const txHashPromise = self.changeRequirement.sendTransactionAsync(_required
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_required: BigNumber,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -1029,6 +1238,34 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
transactionId: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as AssetProxyOwnerContract;
|
||||
const txHashPromise = self.confirmTransaction.sendTransactionAsync(transactionId
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
transactionId: BigNumber,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -1111,6 +1348,38 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
destination: string,
|
||||
value: BigNumber,
|
||||
data: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as AssetProxyOwnerContract;
|
||||
const txHashPromise = self.submitTransaction.sendTransactionAsync(destination,
|
||||
value,
|
||||
data
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
destination: string,
|
||||
value: BigNumber,
|
||||
@@ -1282,6 +1551,36 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
owner: string,
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as AssetProxyOwnerContract;
|
||||
const txHashPromise = self.replaceOwner.sendTransactionAsync(owner,
|
||||
newOwner
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
owner: string,
|
||||
newOwner: string,
|
||||
@@ -1364,6 +1663,34 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
transactionId: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as AssetProxyOwnerContract;
|
||||
const txHashPromise = self.executeTransaction.sendTransactionAsync(transactionId
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
transactionId: BigNumber,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -1489,7 +1816,7 @@ _secondsTimeLocked
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('AssetProxyOwner', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
|
||||
super('AssetProxyOwner', abi, address, supportedProvider, txDefaults);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
|
@@ -1,13 +1,24 @@
|
||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
|
||||
// tslint:disable:no-unused-variable
|
||||
// tslint:disable:no-unbound-method
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
|
||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
DecodedLogArgs,
|
||||
MethodAbi,
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
|
||||
@@ -80,6 +91,42 @@ export class CoordinatorContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
transaction: {salt: BigNumber;signerAddress: string;data: string},
|
||||
txOrigin: string,
|
||||
transactionSignature: string,
|
||||
approvalExpirationTimeSeconds: BigNumber[],
|
||||
approvalSignatures: string[],
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as CoordinatorContract;
|
||||
const txHashPromise = self.executeTransaction.sendTransactionAsync(transaction,
|
||||
txOrigin,
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
transaction: {salt: BigNumber;signerAddress: string;data: string},
|
||||
txOrigin: string,
|
||||
|
@@ -1,13 +1,24 @@
|
||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
|
||||
// tslint:disable:no-unused-variable
|
||||
// tslint:disable:no-unbound-method
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
|
||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
DecodedLogArgs,
|
||||
MethodAbi,
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
export type CoordinatorRegistryEventArgs =
|
||||
@@ -50,6 +61,34 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
coordinatorEndpoint: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as CoordinatorRegistryContract;
|
||||
const txHashPromise = self.setCoordinatorEndpoint.sendTransactionAsync(coordinatorEndpoint
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
coordinatorEndpoint: string,
|
||||
txData: Partial<TxData> = {},
|
||||
|
@@ -1,13 +1,24 @@
|
||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
|
||||
// tslint:disable:no-unused-variable
|
||||
// tslint:disable:no-unbound-method
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
|
||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
DecodedLogArgs,
|
||||
MethodAbi,
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
export type DummyERC20TokenEventArgs =
|
||||
@@ -88,6 +99,36 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_spender: string,
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_spender,
|
||||
_value
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_spender: string,
|
||||
_value: BigNumber,
|
||||
@@ -202,6 +243,38 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(_from,
|
||||
_to,
|
||||
_value
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -396,6 +469,34 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const txHashPromise = self.mint.sendTransactionAsync(_value
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_value: BigNumber,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -475,6 +576,36 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const txHashPromise = self.transfer.sendTransactionAsync(_to,
|
||||
_value
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
@@ -590,6 +721,36 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_target: string,
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const txHashPromise = self.setBalance.sendTransactionAsync(_target,
|
||||
_value
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_target: string,
|
||||
_value: BigNumber,
|
||||
@@ -672,6 +833,34 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
newOwner: string,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -823,7 +1012,7 @@ _totalSupply
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('DummyERC20Token', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
|
||||
super('DummyERC20Token', abi, address, supportedProvider, txDefaults);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
|
@@ -1,13 +1,24 @@
|
||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
|
||||
// tslint:disable:no-unused-variable
|
||||
// tslint:disable:no-unbound-method
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
|
||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
DecodedLogArgs,
|
||||
MethodAbi,
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
export type DummyERC721TokenEventArgs =
|
||||
@@ -124,6 +135,36 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_approved: string,
|
||||
_tokenId: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_approved,
|
||||
_tokenId
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_approved: string,
|
||||
_tokenId: BigNumber,
|
||||
@@ -212,6 +253,38 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
_tokenId: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(_from,
|
||||
_to,
|
||||
_tokenId
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -303,6 +376,36 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_to: string,
|
||||
_tokenId: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const txHashPromise = self.mint.sendTransactionAsync(_to,
|
||||
_tokenId
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_to: string,
|
||||
_tokenId: BigNumber,
|
||||
@@ -391,6 +494,38 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
_tokenId: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const txHashPromise = self.safeTransferFrom1.sendTransactionAsync(_from,
|
||||
_to,
|
||||
_tokenId
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -590,6 +725,36 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_owner: string,
|
||||
_tokenId: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const txHashPromise = self.burn.sendTransactionAsync(_owner,
|
||||
_tokenId
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_owner: string,
|
||||
_tokenId: BigNumber,
|
||||
@@ -675,6 +840,36 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_operator: string,
|
||||
_approved: boolean,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const txHashPromise = self.setApprovalForAll.sendTransactionAsync(_operator,
|
||||
_approved
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_operator: string,
|
||||
_approved: boolean,
|
||||
@@ -766,6 +961,40 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
_tokenId: BigNumber,
|
||||
_data: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const txHashPromise = self.safeTransferFrom2.sendTransactionAsync(_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -890,6 +1119,34 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
newOwner: string,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -1001,7 +1258,7 @@ _symbol
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('DummyERC721Token', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
|
||||
super('DummyERC721Token', abi, address, supportedProvider, txDefaults);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
|
@@ -1,13 +1,24 @@
|
||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
|
||||
// tslint:disable:no-unused-variable
|
||||
// tslint:disable:no-unbound-method
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
|
||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
DecodedLogArgs,
|
||||
MethodAbi,
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
|
||||
@@ -38,6 +49,34 @@ export class DutchAuctionContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const txHashPromise = self.getAuctionDetails.sendTransactionAsync(order
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -123,6 +162,40 @@ export class DutchAuctionContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
buyOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
sellOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
buySignature: string,
|
||||
sellSignature: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const txHashPromise = self.matchOrders.sendTransactionAsync(buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
buyOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
sellOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
@@ -245,7 +318,7 @@ export class DutchAuctionContract extends BaseContract {
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('DutchAuction', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
|
||||
super('DutchAuction', abi, address, supportedProvider, txDefaults);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
|
@@ -1,13 +1,24 @@
|
||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
|
||||
// tslint:disable:no-unused-variable
|
||||
// tslint:disable:no-unbound-method
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
|
||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
DecodedLogArgs,
|
||||
MethodAbi,
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
export type ERC20ProxyEventArgs =
|
||||
@@ -57,6 +68,34 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -161,6 +200,34 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -266,6 +333,36 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(target,
|
||||
index
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
@@ -428,6 +525,34 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
newOwner: string,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -525,7 +650,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('ERC20Proxy', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
|
||||
super('ERC20Proxy', abi, address, supportedProvider, txDefaults);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
|
@@ -1,13 +1,24 @@
|
||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
|
||||
// tslint:disable:no-unused-variable
|
||||
// tslint:disable:no-unbound-method
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
|
||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
DecodedLogArgs,
|
||||
MethodAbi,
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
export type ERC20TokenEventArgs =
|
||||
@@ -62,6 +73,36 @@ export class ERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_spender: string,
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_spender,
|
||||
_value
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_spender: string,
|
||||
_value: BigNumber,
|
||||
@@ -176,6 +217,38 @@ export class ERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(_from,
|
||||
_to,
|
||||
_value
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -295,6 +368,36 @@ export class ERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const txHashPromise = self.transfer.sendTransactionAsync(_to,
|
||||
_value
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
@@ -428,7 +531,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('ERC20Token', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
|
||||
super('ERC20Token', abi, address, supportedProvider, txDefaults);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
|
@@ -1,13 +1,24 @@
|
||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
|
||||
// tslint:disable:no-unused-variable
|
||||
// tslint:disable:no-unbound-method
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
|
||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
DecodedLogArgs,
|
||||
MethodAbi,
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
export type ERC721ProxyEventArgs =
|
||||
@@ -57,6 +68,34 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -161,6 +200,34 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -266,6 +333,36 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(target,
|
||||
index
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
@@ -428,6 +525,34 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
newOwner: string,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -525,7 +650,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('ERC721Proxy', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
|
||||
super('ERC721Proxy', abi, address, supportedProvider, txDefaults);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
|
@@ -1,13 +1,24 @@
|
||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
|
||||
// tslint:disable:no-unused-variable
|
||||
// tslint:disable:no-unbound-method
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
|
||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
DecodedLogArgs,
|
||||
MethodAbi,
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
export type ERC721TokenEventArgs =
|
||||
@@ -98,6 +109,36 @@ export class ERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_approved: string,
|
||||
_tokenId: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_approved,
|
||||
_tokenId
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_approved: string,
|
||||
_tokenId: BigNumber,
|
||||
@@ -186,6 +227,38 @@ export class ERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
_tokenId: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(_from,
|
||||
_to,
|
||||
_tokenId
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -280,6 +353,38 @@ export class ERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
_tokenId: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const txHashPromise = self.safeTransferFrom1.sendTransactionAsync(_from,
|
||||
_to,
|
||||
_tokenId
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -427,6 +532,36 @@ export class ERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_operator: string,
|
||||
_approved: boolean,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const txHashPromise = self.setApprovalForAll.sendTransactionAsync(_operator,
|
||||
_approved
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_operator: string,
|
||||
_approved: boolean,
|
||||
@@ -518,6 +653,40 @@ export class ERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
_tokenId: BigNumber,
|
||||
_data: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const txHashPromise = self.safeTransferFrom2.sendTransactionAsync(_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -663,7 +832,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('ERC721Token', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
|
||||
super('ERC721Token', abi, address, supportedProvider, txDefaults);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
|
@@ -1,13 +1,24 @@
|
||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
|
||||
// tslint:disable:no-unused-variable
|
||||
// tslint:disable:no-unbound-method
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
|
||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
DecodedLogArgs,
|
||||
MethodAbi,
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
export type ExchangeEventArgs =
|
||||
@@ -127,6 +138,38 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
takerAssetFillAmounts: BigNumber[],
|
||||
signatures: string[],
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.batchFillOrders.sendTransactionAsync(orders,
|
||||
takerAssetFillAmounts,
|
||||
signatures
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
takerAssetFillAmounts: BigNumber[],
|
||||
@@ -249,6 +292,38 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
hash: string,
|
||||
signerAddress: string,
|
||||
signature: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.preSign.sendTransactionAsync(hash,
|
||||
signerAddress,
|
||||
signature
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
hash: string,
|
||||
signerAddress: string,
|
||||
@@ -346,6 +421,40 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
leftOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
rightOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
leftSignature: string,
|
||||
rightSignature: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.matchOrders.sendTransactionAsync(leftOrder,
|
||||
rightOrder,
|
||||
leftSignature,
|
||||
rightSignature
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
leftOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
rightOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
@@ -446,6 +555,38 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
takerAssetFillAmount: BigNumber,
|
||||
signature: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.fillOrderNoThrow.sendTransactionAsync(order,
|
||||
takerAssetFillAmount,
|
||||
signature
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
takerAssetFillAmount: BigNumber,
|
||||
@@ -562,6 +703,34 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.batchCancelOrders.sendTransactionAsync(orders
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -644,6 +813,38 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
takerAssetFillAmounts: BigNumber[],
|
||||
signatures: string[],
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.batchFillOrKillOrders.sendTransactionAsync(orders,
|
||||
takerAssetFillAmounts,
|
||||
signatures
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
takerAssetFillAmounts: BigNumber[],
|
||||
@@ -732,6 +933,34 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
targetOrderEpoch: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.cancelOrdersUpTo.sendTransactionAsync(targetOrderEpoch
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
targetOrderEpoch: BigNumber,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -814,6 +1043,38 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
takerAssetFillAmounts: BigNumber[],
|
||||
signatures: string[],
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.batchFillOrdersNoThrow.sendTransactionAsync(orders,
|
||||
takerAssetFillAmounts,
|
||||
signatures
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
takerAssetFillAmounts: BigNumber[],
|
||||
@@ -964,6 +1225,38 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
takerAssetFillAmount: BigNumber,
|
||||
signature: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.fillOrKillOrder.sendTransactionAsync(order,
|
||||
takerAssetFillAmount,
|
||||
signature
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
takerAssetFillAmount: BigNumber,
|
||||
@@ -1055,6 +1348,36 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
validatorAddress: string,
|
||||
approval: boolean,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.setSignatureValidatorApproval.sendTransactionAsync(validatorAddress,
|
||||
approval
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
validatorAddress: string,
|
||||
approval: boolean,
|
||||
@@ -1173,6 +1496,38 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
takerAssetFillAmount: BigNumber,
|
||||
signatures: string[],
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.marketSellOrders.sendTransactionAsync(orders,
|
||||
takerAssetFillAmount,
|
||||
signatures
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
takerAssetFillAmount: BigNumber,
|
||||
@@ -1383,6 +1738,38 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
makerAssetFillAmount: BigNumber,
|
||||
signatures: string[],
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.marketBuyOrdersNoThrow.sendTransactionAsync(orders,
|
||||
makerAssetFillAmount,
|
||||
signatures
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
makerAssetFillAmount: BigNumber,
|
||||
@@ -1477,6 +1864,38 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
takerAssetFillAmount: BigNumber,
|
||||
signature: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.fillOrder.sendTransactionAsync(order,
|
||||
takerAssetFillAmount,
|
||||
signature
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
takerAssetFillAmount: BigNumber,
|
||||
@@ -1574,6 +1993,40 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
salt: BigNumber,
|
||||
signerAddress: string,
|
||||
data: string,
|
||||
signature: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.executeTransaction.sendTransactionAsync(salt,
|
||||
signerAddress,
|
||||
data,
|
||||
signature
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
salt: BigNumber,
|
||||
signerAddress: string,
|
||||
@@ -1668,6 +2121,34 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
assetProxy: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.registerAssetProxy.sendTransactionAsync(assetProxy
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
assetProxy: string,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -1772,6 +2253,34 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.cancelOrder.sendTransactionAsync(order
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -1910,6 +2419,38 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
takerAssetFillAmount: BigNumber,
|
||||
signatures: string[],
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.marketSellOrdersNoThrow.sendTransactionAsync(orders,
|
||||
takerAssetFillAmount,
|
||||
signatures
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
takerAssetFillAmount: BigNumber,
|
||||
@@ -2030,6 +2571,38 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
makerAssetFillAmount: BigNumber,
|
||||
signatures: string[],
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.marketBuyOrders.sendTransactionAsync(orders,
|
||||
makerAssetFillAmount,
|
||||
signatures
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
makerAssetFillAmount: BigNumber,
|
||||
@@ -2144,6 +2717,34 @@ export class ExchangeContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ExchangeContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
newOwner: string,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -2274,7 +2875,7 @@ export class ExchangeContract extends BaseContract {
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('Exchange', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
|
||||
super('Exchange', abi, address, supportedProvider, txDefaults);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
|
@@ -1,13 +1,24 @@
|
||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
|
||||
// tslint:disable:no-unused-variable
|
||||
// tslint:disable:no-unbound-method
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
|
||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
DecodedLogArgs,
|
||||
MethodAbi,
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
|
||||
@@ -56,6 +67,46 @@ export class ForwarderContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
makerAssetFillAmount: BigNumber,
|
||||
signatures: string[],
|
||||
feeOrders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
feeSignatures: string[],
|
||||
feePercentage: BigNumber,
|
||||
feeRecipient: string,
|
||||
txData?: Partial<TxDataPayable> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ForwarderContract;
|
||||
const txHashPromise = self.marketBuyOrdersWithEth.sendTransactionAsync(orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
makerAssetFillAmount: BigNumber,
|
||||
@@ -171,6 +222,36 @@ export class ForwarderContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
assetData: string,
|
||||
amount: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ForwarderContract;
|
||||
const txHashPromise = self.withdrawAsset.sendTransactionAsync(assetData,
|
||||
amount
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
assetData: string,
|
||||
amount: BigNumber,
|
||||
@@ -294,6 +375,44 @@ export class ForwarderContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
signatures: string[],
|
||||
feeOrders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
feeSignatures: string[],
|
||||
feePercentage: BigNumber,
|
||||
feeRecipient: string,
|
||||
txData?: Partial<TxDataPayable> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ForwarderContract;
|
||||
const txHashPromise = self.marketSellOrdersWithEth.sendTransactionAsync(orders,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
|
||||
signatures: string[],
|
||||
@@ -400,6 +519,34 @@ export class ForwarderContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as ForwarderContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
newOwner: string,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -518,7 +665,7 @@ _wethAssetData
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('Forwarder', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
|
||||
super('Forwarder', abi, address, supportedProvider, txDefaults);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
|
@@ -1,13 +1,24 @@
|
||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
|
||||
// tslint:disable:no-unused-variable
|
||||
// tslint:disable:no-unbound-method
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
|
||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
DecodedLogArgs,
|
||||
MethodAbi,
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
|
||||
@@ -38,6 +49,34 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -114,6 +153,34 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
txData: Partial<TxData> = {},
|
||||
@@ -193,6 +260,36 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(target,
|
||||
index
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
@@ -284,6 +381,40 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
assetData: string,
|
||||
from: string,
|
||||
to: string,
|
||||
amount: BigNumber,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(assetData,
|
||||
from,
|
||||
to,
|
||||
amount
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
assetData: string,
|
||||
from: string,
|
||||
@@ -430,6 +561,34 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData> | number,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
// `txData` may be omitted on its own, so it might be set to `pollingIntervalMs`.
|
||||
if (typeof(txData) === 'number') {
|
||||
pollingIntervalMs = txData;
|
||||
timeoutMs = pollingIntervalMs;
|
||||
txData = {};
|
||||
}
|
||||
//
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner
|
||||
, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
// When the transaction hash resolves, wait for it to be mined.
|
||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await txHashPromise,
|
||||
pollingIntervalMs,
|
||||
timeoutMs,
|
||||
);
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
newOwner: string,
|
||||
txData: Partial<TxData> = {},
|
||||
|
@@ -1,13 +1,24 @@
|
||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
|
||||
// tslint:disable:no-unused-variable
|
||||
// tslint:disable:no-unbound-method
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
|
||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
DecodedLogArgs,
|
||||
MethodAbi,
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
|
||||
@@ -91,7 +102,7 @@ export class IValidatorContract extends BaseContract {
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('IValidator', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
|
||||
super('IValidator', abi, address, supportedProvider, txDefaults);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
|
@@ -1,13 +1,24 @@
|
||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
|
||||
// tslint:disable:no-unused-variable
|
||||
// tslint:disable:no-unbound-method
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
|
||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
DecodedLogArgs,
|
||||
MethodAbi,
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
|
||||
@@ -89,7 +100,7 @@ export class IWalletContract extends BaseContract {
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('IWallet', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
|
||||
super('IWallet', abi, address, supportedProvider, txDefaults);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user