Compare commits
72 Commits
@0x/abi-ge
...
@0x/utils@
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f3cee1a1e | ||
|
|
c43d4bbf71 | ||
|
|
b7337410aa | ||
|
|
10b7d7da3f | ||
|
|
e69d2bb54a | ||
|
|
ead8099109 | ||
|
|
1e6e74878f | ||
|
|
cbcede3b63 | ||
|
|
98fd731485 | ||
|
|
9ca319b4ea | ||
|
|
ff8fabf49e | ||
|
|
1e00f68941 | ||
|
|
6c79edd3b2 | ||
|
|
b79bc6bab9 | ||
|
|
c59d886662 | ||
|
|
e39dce6159 | ||
|
|
620c66fb4c | ||
|
|
3af91d54cb | ||
|
|
1fe1bcff98 | ||
|
|
c58c12c5b3 | ||
|
|
1aeea39eb3 | ||
|
|
d3fbf020de | ||
|
|
8ce8bee76f | ||
|
|
dcf4eb2aaf | ||
|
|
88ff38eca6 | ||
|
|
bf0d90d079 | ||
|
|
c4d9ef9f83 | ||
|
|
37bce53683 | ||
|
|
05d50b62c9 | ||
|
|
eb2fb7f790 | ||
|
|
d280ccb3c4 | ||
|
|
a569815840 | ||
|
|
9e41c3093b | ||
|
|
9dbc9a8ad9 | ||
|
|
c940157814 | ||
|
|
4f19875a58 | ||
|
|
dcbadb2386 | ||
|
|
405a7b2037 | ||
|
|
e69ad24737 | ||
|
|
a31056a4ec | ||
|
|
d41dddddcd | ||
|
|
251ae50d3e | ||
|
|
4ccd2d4955 | ||
|
|
dfb79e0998 | ||
|
|
590055e2ba | ||
|
|
f388751a97 | ||
|
|
53136caaa4 | ||
|
|
dd20d8d6de | ||
|
|
a977957946 | ||
|
|
8974fcabe3 | ||
|
|
aff8e1e025 | ||
|
|
10d767c5ab | ||
|
|
77484dc69e | ||
|
|
185e2342d9 | ||
|
|
54f4727adc | ||
|
|
6e0f982163 | ||
|
|
43072ef80d | ||
|
|
7618e63f49 | ||
|
|
542255332d | ||
|
|
6d6e7e1468 | ||
|
|
0ff88d5c21 | ||
|
|
092e35bae3 | ||
|
|
ac82b2622c | ||
|
|
7197cb57cd | ||
|
|
030d66cb63 | ||
|
|
d414e6a7c4 | ||
|
|
30f9c94620 | ||
|
|
b6b618e5ce | ||
|
|
0bb8887027 | ||
|
|
fabfdd0aa2 | ||
|
|
8f8336b344 | ||
|
|
d10659f986 |
@@ -33,6 +33,10 @@ jobs:
|
||||
key: python-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/packages/python-contract-wrappers/generated
|
||||
- store_artifacts:
|
||||
path: ~/repo/packages/python-contract-wrappers/generated
|
||||
- store_artifacts:
|
||||
path: ~/repo/packages/abi-gen/test-cli/output
|
||||
build-website:
|
||||
resource_class: medium+
|
||||
docker:
|
||||
@@ -102,7 +106,6 @@ jobs:
|
||||
- run: yarn wsrun test:circleci @0x/contract-wrappers
|
||||
- run: yarn wsrun test:circleci @0x/dev-utils
|
||||
- run: yarn wsrun test:circleci @0x/json-schemas
|
||||
- run: yarn wsrun test:circleci @0x/metacoin
|
||||
- run: yarn wsrun test:circleci @0x/order-utils
|
||||
- run: yarn wsrun test:circleci @0x/order-watcher
|
||||
- run: yarn wsrun test:circleci @0x/sol-compiler
|
||||
@@ -144,10 +147,6 @@ jobs:
|
||||
key: coverage-json-schemas-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/packages/json-schemas/coverage/lcov.info
|
||||
- save_cache:
|
||||
key: coverage-metacoin-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/packages/metacoin/coverage/lcov.info
|
||||
- save_cache:
|
||||
key: coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
@@ -209,7 +208,8 @@ jobs:
|
||||
- run:
|
||||
command: |
|
||||
cd python-packages
|
||||
./cmd_pkgs_in_dep_order.py coverage run setup.py test
|
||||
./parallel coverage run setup.py test
|
||||
./build_docs
|
||||
- save_cache:
|
||||
key: coverage-python-contract-addresses-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
@@ -234,6 +234,24 @@ jobs:
|
||||
key: coverage-python-sra-client-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/python-packages/sra_client/.coverage
|
||||
- store_artifacts:
|
||||
path: ~/repo/python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc20_token/__init__.py
|
||||
- store_artifacts:
|
||||
path: ~/repo/python-packages/contract_wrappers/src/zero_ex/contract_wrappers/exchange/__init__.py
|
||||
- store_artifacts:
|
||||
path: ~/repo/python-packages/contract_addresses/build
|
||||
- store_artifacts:
|
||||
path: ~/repo/python-packages/contract_artifacts/build
|
||||
- store_artifacts:
|
||||
path: ~/repo/python-packages/contract_wrappers/build
|
||||
- store_artifacts:
|
||||
path: ~/repo/python-packages/json_schemas/build
|
||||
- store_artifacts:
|
||||
path: ~/repo/python-packages/middlewares/build
|
||||
- store_artifacts:
|
||||
path: ~/repo/python-packages/order_utils/build
|
||||
- store_artifacts:
|
||||
path: ~/repo/python-packages/sra_client/build
|
||||
test-rest-python:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
@@ -326,9 +344,6 @@ jobs:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-json-schemas-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-metacoin-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
|
||||
|
||||
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -3,5 +3,5 @@
|
||||
# Automatically collapse generated files in GitHub.
|
||||
*.svg linguist-generated=true
|
||||
packages/contract-artifacts/artifacts/*json linguist-generated=true
|
||||
packages/abi-gen-wrappers/src/generated-wrappers/*.ts liguist-generated=true
|
||||
packages/abi-gen-wrappers/src/generated-wrappers/*.ts linguist-generated=true
|
||||
|
||||
|
||||
1
.github/autolabeler.yml
vendored
1
.github/autolabeler.yml
vendored
@@ -30,7 +30,6 @@ contracts: ['contracts']
|
||||
@0x/typescript-typings: ['packages/typescript-typings']
|
||||
0x.js: ['packages/0x.js']
|
||||
@0x/abi-gen-wrappers: ['packages/abi-gen-wrappers']
|
||||
@0x/metacoin: ['packages/metacoin']
|
||||
@0x/contract-artifacts: ['packages/contract-artifacts']
|
||||
@0x/dev-utils: ['packages/dev-utils']
|
||||
@0x/contract-wrappers: ['packages/contract-wrappers']
|
||||
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -96,7 +96,6 @@ contracts/extensions/generated-artifacts/
|
||||
contracts/exchange-forwarder/generated-artifacts/
|
||||
contracts/dev-utils/generated-artifacts/
|
||||
packages/sol-tracing-utils/test/fixtures/artifacts/
|
||||
packages/metacoin/artifacts/
|
||||
python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/
|
||||
|
||||
# generated contract wrappers
|
||||
@@ -114,7 +113,8 @@ contracts/erc1155/generated-wrappers/
|
||||
contracts/extensions/generated-wrappers/
|
||||
contracts/exchange-forwarder/generated-wrappers/
|
||||
contracts/dev-utils/generated-wrappers/
|
||||
packages/metacoin/src/contract_wrappers
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc20_token/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/exchange/__init__.py
|
||||
|
||||
# cli test output
|
||||
packages/abi-gen/test-cli/output
|
||||
@@ -134,3 +134,6 @@ python-packages/*/dist
|
||||
__pycache__
|
||||
python-packages/*/src/*.egg-info
|
||||
python-packages/*/.coverage
|
||||
|
||||
# python keeps package-local copies of json schemas
|
||||
python-packages/json_schemas/src/zero_ex/json_schemas/schemas
|
||||
|
||||
@@ -27,8 +27,6 @@ lib
|
||||
/packages/abi-gen/test-cli/output
|
||||
/packages/json-schemas/schemas
|
||||
/python-packages/json_schemas/src/zero_ex/json_schemas/schemas
|
||||
/packages/metacoin/src/contract_wrappers
|
||||
/packages/metacoin/artifacts
|
||||
/packages/sra-spec/public/
|
||||
/packages/dev-tools-pages/ts/**/data.json
|
||||
package.json
|
||||
@@ -37,3 +35,6 @@ packages/sol-coverage/test/fixtures/artifacts
|
||||
.pytest_cache
|
||||
.mypy_cache
|
||||
.tox
|
||||
packages/abi-gen/test-cli/fixtures/artifacts/AbiGenDummy.json
|
||||
packages/abi-gen/test-cli/fixtures/artifacts/LibDummy.json
|
||||
packages/abi-gen/test-cli/fixtures/artifacts/TestLibDummy.json
|
||||
|
||||
@@ -20,7 +20,6 @@ packages/contract-artifacts/ @albrow
|
||||
packages/dev-utils/ @LogvinovLeon @fabioberger
|
||||
packages/devnet/ @albrow
|
||||
packages/ethereum-types/ @LogvinovLeon
|
||||
packages/metacoin/ @LogvinovLeon
|
||||
packages/monorepo-scripts/ @fabioberger
|
||||
packages/order-utils/ @fabioberger @LogvinovLeon
|
||||
packages/python-contract-wrappers/ @feuGeneA
|
||||
|
||||
@@ -70,6 +70,7 @@ These packages are all under development. See [/contracts/README.md](/contracts/
|
||||
| [`@0x/sra-spec`](/packages/sra-spec) | [](https://www.npmjs.com/package/@0x/sra-spec) | OpenAPI specification for the Standard Relayer API |
|
||||
| [`@0x/connect`](/packages/connect) | [](https://www.npmjs.com/package/@0x/connect) | An HTTP/WS client for interacting with the Standard Relayer API |
|
||||
| [`@0x/asset-buyer`](/packages/asset-buyer) | [](https://www.npmjs.com/package/@0x/asset-buyer) | Convenience package for discovering and buying assets with Ether |
|
||||
| [`@0x/asset-swapper`](/packages/asset-swapper) | [](https://www.npmjs.com/package/@0x/asset-swapper) | Convenience package for discovering and performing swaps for any ERC20 Assets |
|
||||
|
||||
#### Ethereum tooling
|
||||
|
||||
|
||||
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "2.2.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563193019,
|
||||
"version": "2.2.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563047529,
|
||||
"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.3 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.2 - _July 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.1 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.0 - _July 13, 2019_
|
||||
|
||||
* Add `LibAssetProxyIds` contract (#1835)
|
||||
|
||||
@@ -18,349 +18,71 @@
|
||||
|
||||
pragma solidity ^0.5.9;
|
||||
|
||||
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
|
||||
import "@0x/contracts-utils/contracts/src/SafeMath.sol";
|
||||
import "@0x/contracts-erc1155/contracts/src/interfaces/IERC1155.sol";
|
||||
import "./MixinAuthorizable.sol";
|
||||
import "./interfaces/IAssetProxy.sol";
|
||||
|
||||
|
||||
contract ERC1155Proxy is
|
||||
MixinAuthorizable
|
||||
MixinAuthorizable,
|
||||
SafeMath,
|
||||
IAssetProxy
|
||||
{
|
||||
using LibBytes for bytes;
|
||||
|
||||
// Id of this proxy.
|
||||
bytes4 constant internal PROXY_ID = bytes4(keccak256("ERC1155Assets(address,uint256[],uint256[],bytes)"));
|
||||
|
||||
// solhint-disable-next-line payable-fallback
|
||||
function ()
|
||||
/// @dev Transfers batch of ERC1155 assets. Either succeeds or throws.
|
||||
/// @param assetData Byte array encoded with ERC1155 token address, array of ids, array of values, and callback data.
|
||||
/// @param from Address to transfer assets from.
|
||||
/// @param to Address to transfer assets to.
|
||||
/// @param amount Amount that will be multiplied with each element of `assetData.values` to scale the
|
||||
/// values that will be transferred.
|
||||
function transferFrom(
|
||||
bytes calldata assetData,
|
||||
address from,
|
||||
address to,
|
||||
uint256 amount
|
||||
)
|
||||
external
|
||||
onlyAuthorized
|
||||
{
|
||||
// Input calldata to this function is encoded as follows:
|
||||
// -- TABLE #1 --
|
||||
// | Area | Offset (**) | Length | Contents |
|
||||
// |----------|-------------|-------------|---------------------------------|
|
||||
// | Header | 0 | 4 | function selector |
|
||||
// | Params | | 4 * 32 | function parameters: |
|
||||
// | | 4 | | 1. offset to assetData (*) |
|
||||
// | | 36 | | 2. from |
|
||||
// | | 68 | | 3. to |
|
||||
// | | 100 | | 4. amount |
|
||||
// | Data | | | assetData: |
|
||||
// | | 132 | 32 | assetData Length |
|
||||
// | | 164 | (see below) | assetData Contents |
|
||||
//
|
||||
//
|
||||
// Asset data is encoded as follows:
|
||||
// -- TABLE #2 --
|
||||
// | Area | Offset | Length | Contents |
|
||||
// |----------|-------------|---------|-------------------------------------|
|
||||
// | Header | 0 | 4 | assetProxyId |
|
||||
// | Params | | 4 * 32 | function parameters: |
|
||||
// | | 4 | | 1. address of ERC1155 contract |
|
||||
// | | 36 | | 2. offset to ids (*) |
|
||||
// | | 68 | | 3. offset to values (*) |
|
||||
// | | 100 | | 4. offset to data (*) |
|
||||
// | Data | | | ids: |
|
||||
// | | 132 | 32 | 1. ids Length |
|
||||
// | | 164 | a | 2. ids Contents |
|
||||
// | | | | values: |
|
||||
// | | 164 + a | 32 | 1. values Length |
|
||||
// | | 196 + a | b | 2. values Contents |
|
||||
// | | | | data: |
|
||||
// | | 196 + a + b | 32 | 1. data Length |
|
||||
// | | 228 + a + b | c | 2. data Contents |
|
||||
//
|
||||
//
|
||||
// Calldata for target ERC155 asset is encoded for safeBatchTransferFrom:
|
||||
// -- TABLE #3 --
|
||||
// | Area | Offset (**) | Length | Contents |
|
||||
// |----------|-------------|---------|-------------------------------------|
|
||||
// | Header | 0 | 4 | safeBatchTransferFrom selector |
|
||||
// | Params | | 5 * 32 | function parameters: |
|
||||
// | | 4 | | 1. from address |
|
||||
// | | 36 | | 2. to address |
|
||||
// | | 68 | | 3. offset to ids (*) |
|
||||
// | | 100 | | 4. offset to values (*) |
|
||||
// | | 132 | | 5. offset to data (*) |
|
||||
// | Data | | | ids: |
|
||||
// | | 164 | 32 | 1. ids Length |
|
||||
// | | 196 | a | 2. ids Contents |
|
||||
// | | | | values: |
|
||||
// | | 196 + a | 32 | 1. values Length |
|
||||
// | | 228 + a | b | 2. values Contents |
|
||||
// | | | | data: |
|
||||
// | | 228 + a + b | 32 | 1. data Length |
|
||||
// | | 260 + a + b | c | 2. data Contents |
|
||||
//
|
||||
//
|
||||
// (*): offset is computed from start of function parameters, so offset
|
||||
// by an additional 4 bytes in the calldata.
|
||||
//
|
||||
// (**): the `Offset` column is computed assuming no calldata compression;
|
||||
// offsets in the Data Area are dynamic and should be evaluated in
|
||||
// real-time.
|
||||
//
|
||||
// WARNING: The ABIv2 specification allows additional padding between
|
||||
// the Params and Data section. This will result in a larger
|
||||
// offset to assetData.
|
||||
//
|
||||
// Note: Table #1 and Table #2 exist in Calldata. We construct Table #3 in memory.
|
||||
//
|
||||
//
|
||||
assembly {
|
||||
// The first 4 bytes of calldata holds the function selector
|
||||
let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)
|
||||
// Decode params from `assetData`
|
||||
// solhint-disable indent
|
||||
(
|
||||
address erc1155TokenAddress,
|
||||
uint256[] memory ids,
|
||||
uint256[] memory values,
|
||||
bytes memory data
|
||||
) = abi.decode(
|
||||
assetData.sliceDestructive(4, assetData.length),
|
||||
(address, uint256[], uint256[], bytes)
|
||||
);
|
||||
// solhint-enable indent
|
||||
|
||||
// `transferFrom` will be called with the following parameters:
|
||||
// assetData Encoded byte array.
|
||||
// from Address to transfer asset from.
|
||||
// to Address to transfer asset to.
|
||||
// amount Amount of asset to transfer.
|
||||
// bytes4(keccak256("transferFrom(bytes,address,address,uint256)")) = 0xa85e59e4
|
||||
if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {
|
||||
|
||||
// To lookup a value in a mapping, we load from the storage location keccak256(k, p),
|
||||
// where k is the key left padded to 32 bytes and p is the storage slot
|
||||
mstore(0, caller)
|
||||
mstore(32, authorized_slot)
|
||||
|
||||
// Revert if authorized[msg.sender] == false
|
||||
if iszero(sload(keccak256(0, 64))) {
|
||||
// Revert with `Error("SENDER_NOT_AUTHORIZED")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
// Construct Table #3 in memory, starting at memory offset 0.
|
||||
// The algorithm below maps calldata (Table #1) and assetData (Table #2) to memory (Table #3).
|
||||
// Once Table #3 ha been constructed in memory, the destination erc1155 contract is called using this
|
||||
// as its calldata. This process is divided into three steps, below.
|
||||
|
||||
////////// STEP 1/3 - Map calldata to memory (Table #1 -> Table #3) //////////
|
||||
|
||||
// Store the safeBatchTransferFrom function selector, which is computed using:
|
||||
// bytes4(keccak256("safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)"))
|
||||
mstore(0, 0x2eb2c2d600000000000000000000000000000000000000000000000000000000)
|
||||
|
||||
// Copy `from` and `to` fields from calldata (Table #1) into memory (Table #3)
|
||||
calldatacopy(
|
||||
4, // aligned such that `from` and `to` are at the correct location for Table #3
|
||||
36, // beginning of `from` field from Table #1
|
||||
64 // 32 bytes for `from` + 32 bytes for `to` field
|
||||
)
|
||||
|
||||
////////// STEP 2/3 - Map assetData to memory (Table #2 -> Table #3) //////////
|
||||
|
||||
// Map relevant fields from assetData (Table #2) into memory (Table #3)
|
||||
// The Contents column of Table #2 is the same as Table #3,
|
||||
// beginning from parameter 3 - `offset to ids (*)`
|
||||
// The `values` from assetData (Table #2) are multiplied by `amount` (Table #1)
|
||||
// when they are copied into memory.
|
||||
|
||||
// Load offset to `assetData`
|
||||
let assetDataOffset := add(calldataload(4), 4)
|
||||
|
||||
// Load length in bytes of `assetData`
|
||||
let assetDataLength := calldataload(assetDataOffset)
|
||||
|
||||
// Assert that the length of asset data:
|
||||
// 1. Must be at least 132 bytes (Table #2)
|
||||
// 2. Must be a multiple of 32 (excluding the 4-byte selector)
|
||||
if or(lt(assetDataLength, 132), mod(sub(assetDataLength, 4), 32)) {
|
||||
// Revert with `Error("INVALID_ASSET_DATA_LENGTH")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x00000019494e56414c49445f41535345545f444154415f4c454e475448000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
// End of asset data in calldata
|
||||
// +32 for length field
|
||||
let assetDataEnd := add(assetDataOffset, add(assetDataLength, 32))
|
||||
if gt(assetDataEnd, calldatasize()) {
|
||||
// Revert with `Error("INVALID_ASSET_DATA_END")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x00000016494e56414c49445f41535345545f444154415f454e44000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
// Load offset to parameters section in asset data
|
||||
let paramsInAssetDataOffset := add(assetDataOffset, 36)
|
||||
|
||||
// Offset of end of Data Area in memory.
|
||||
// This value will grow as we construct Table #3.
|
||||
let dataAreaEndOffset := 164
|
||||
|
||||
// Load amount by which to scale values
|
||||
let amount := calldataload(100)
|
||||
|
||||
// Store pointer to `ids` (Table #3)
|
||||
// Subtract 4 for `safeBatchTransferFrom` selector
|
||||
mstore(68, sub(dataAreaEndOffset, 4))
|
||||
|
||||
// Ensure length of `ids` does not overflow
|
||||
let idsOffset := add(paramsInAssetDataOffset, calldataload(add(assetDataOffset, 68)))
|
||||
let idsLength := calldataload(idsOffset)
|
||||
let idsLengthInBytes := mul(idsLength, 32)
|
||||
if sub(div(idsLengthInBytes, 32), idsLength) {
|
||||
// Revert with `Error("UINT256_OVERFLOW")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000001055494e543235365f4f564552464c4f57000000000000000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
// Ensure `ids` does not resolve to outside of `assetData`
|
||||
let idsBegin := add(idsOffset, 32)
|
||||
let idsEnd := add(idsBegin, idsLengthInBytes)
|
||||
if gt(idsEnd, assetDataEnd) {
|
||||
// Revert with `Error("INVALID_IDS_OFFSET")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x00000012494e56414c49445f4944535f4f464653455400000000000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
// Copy `ids` from `assetData` (Table #2) to memory (Table #3)
|
||||
calldatacopy(
|
||||
dataAreaEndOffset,
|
||||
idsOffset,
|
||||
add(idsLengthInBytes, 32)
|
||||
)
|
||||
dataAreaEndOffset := add(dataAreaEndOffset, add(idsLengthInBytes, 32))
|
||||
|
||||
// Store pointer to `values` (Table #3)
|
||||
// Subtract 4 for `safeBatchTrasferFrom` selector
|
||||
mstore(100, sub(dataAreaEndOffset, 4))
|
||||
|
||||
// Ensure length of `values` does not overflow
|
||||
let valuesOffset := add(paramsInAssetDataOffset, calldataload(add(assetDataOffset, 100)))
|
||||
let valuesLength := calldataload(valuesOffset)
|
||||
let valuesLengthInBytes := mul(valuesLength, 32)
|
||||
if sub(div(valuesLengthInBytes, 32), valuesLength) {
|
||||
// Revert with `Error("UINT256_OVERFLOW")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000001055494e543235365f4f564552464c4f57000000000000000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
// Ensure `values` does not resolve to outside of `assetData`
|
||||
let valuesBegin := add(valuesOffset, 32)
|
||||
let valuesEnd := add(valuesBegin, valuesLengthInBytes)
|
||||
if gt(valuesEnd, assetDataEnd) {
|
||||
// Revert with `Error("INVALID_VALUES_OFFSET")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x00000015494e56414c49445f56414c5545535f4f464653455400000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
// Store length of `values`
|
||||
mstore(dataAreaEndOffset, valuesLength)
|
||||
dataAreaEndOffset := add(dataAreaEndOffset, 32)
|
||||
|
||||
// Scale and store elements of `values`
|
||||
for { let currentValueOffset := valuesBegin }
|
||||
lt(currentValueOffset, valuesEnd)
|
||||
{ currentValueOffset := add(currentValueOffset, 32) }
|
||||
{
|
||||
// Load value and generate scaled value
|
||||
let currentValue := calldataload(currentValueOffset)
|
||||
let currentValueScaled := mul(currentValue, amount)
|
||||
|
||||
// Revert if `amount` != 0 and multiplication resulted in an overflow
|
||||
if iszero(or(
|
||||
iszero(amount),
|
||||
eq(div(currentValueScaled, amount), currentValue)
|
||||
)) {
|
||||
// Revert with `Error("UINT256_OVERFLOW")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000001055494e543235365f4f564552464c4f57000000000000000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
// There was no overflow, store the scaled token value
|
||||
mstore(dataAreaEndOffset, currentValueScaled)
|
||||
dataAreaEndOffset := add(dataAreaEndOffset, 32)
|
||||
}
|
||||
|
||||
// Store pointer to `data` (Table #3)
|
||||
// Subtract 4 for `safeBatchTrasferFrom` selector
|
||||
mstore(132, sub(dataAreaEndOffset, 4))
|
||||
|
||||
// Ensure `data` does not resolve to outside of `assetData`
|
||||
let dataOffset := add(paramsInAssetDataOffset, calldataload(add(assetDataOffset, 132)))
|
||||
let dataLengthInBytes := calldataload(dataOffset)
|
||||
let dataBegin := add(dataOffset, 32)
|
||||
let dataEnd := add(dataBegin, dataLengthInBytes)
|
||||
if gt(dataEnd, assetDataEnd) {
|
||||
// Revert with `Error("INVALID_DATA_OFFSET")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x00000013494e56414c49445f444154415f4f4646534554000000000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
// Copy `data` from `assetData` (Table #2) to memory (Table #3)
|
||||
calldatacopy(
|
||||
dataAreaEndOffset,
|
||||
dataOffset,
|
||||
add(dataLengthInBytes, 32)
|
||||
)
|
||||
|
||||
// Update the end of data offset to be word-aligned
|
||||
let dataLengthInWords := div(add(dataLengthInBytes, 31), 32)
|
||||
let dataLengthInBytesWordAligned := mul(dataLengthInWords, 32)
|
||||
dataAreaEndOffset := add(dataAreaEndOffset, add(dataLengthInBytesWordAligned, 32))
|
||||
|
||||
////////// STEP 3/3 - Execute Transfer //////////
|
||||
// Load the address of the destination erc1155 contract from asset data (Table #2)
|
||||
// +32 bytes for assetData Length
|
||||
// +4 bytes for assetProxyId
|
||||
let assetAddress := and(
|
||||
calldataload(add(assetDataOffset, 36)),
|
||||
0x000000000000000000000000ffffffffffffffffffffffffffffffffffffffff
|
||||
)
|
||||
|
||||
// Call into the destination erc1155 contract using as calldata Table #3 (constructed in-memory above)
|
||||
let success := call(
|
||||
gas, // forward all gas
|
||||
assetAddress, // call address of erc1155 asset
|
||||
0, // don't send any ETH
|
||||
0, // pointer to start of input
|
||||
dataAreaEndOffset, // length of input is the end of the Data Area (Table #3)
|
||||
0, // write output over memory that won't be reused
|
||||
0 // don't copy output to memory
|
||||
)
|
||||
|
||||
// Revert with reason given by AssetProxy if `transferFrom` call failed
|
||||
if iszero(success) {
|
||||
returndatacopy(
|
||||
0, // copy to memory at 0
|
||||
0, // copy from return data at 0
|
||||
returndatasize() // copy all return data
|
||||
)
|
||||
revert(0, returndatasize())
|
||||
}
|
||||
|
||||
// Return if call was successful
|
||||
return(0, 0)
|
||||
}
|
||||
|
||||
// Revert if undefined function is called
|
||||
revert(0, 0)
|
||||
// Scale values up by `amount`
|
||||
uint256 length = values.length;
|
||||
uint256[] memory scaledValues = new uint256[](length);
|
||||
for (uint256 i = 0; i != length; i++) {
|
||||
// We write the scaled values to an unused location in memory in order
|
||||
// to avoid copying over `ids` or `data`. This is possible if they are
|
||||
// identical to `values` and the offsets for each are pointing to the
|
||||
// same location in the ABI encoded calldata.
|
||||
scaledValues[i] = safeMul(values[i], amount);
|
||||
}
|
||||
|
||||
// Execute `safeBatchTransferFrom` call
|
||||
// Either succeeds or throws
|
||||
IERC1155(erc1155TokenAddress).safeBatchTransferFrom(
|
||||
from,
|
||||
to,
|
||||
ids,
|
||||
scaledValues,
|
||||
data
|
||||
);
|
||||
}
|
||||
|
||||
/// @dev Gets the proxy id associated with the proxy address.
|
||||
|
||||
@@ -90,7 +90,10 @@ contract MultiAssetProxy is
|
||||
// offset to assetData.
|
||||
|
||||
// Load offset to `assetData`
|
||||
let assetDataOffset := calldataload(4)
|
||||
let assetDataOffset := add(calldataload(4), 4)
|
||||
|
||||
// Load length in bytes of `assetData`
|
||||
let assetDataLength := calldataload(assetDataOffset)
|
||||
|
||||
// Asset data itself is encoded as follows:
|
||||
//
|
||||
@@ -108,41 +111,62 @@ contract MultiAssetProxy is
|
||||
// | | 132 + a | b | nestedAssetData Contents (offsets) |
|
||||
// | | 132 + a + b | | nestedAssetData[0, ..., len] |
|
||||
|
||||
// Assert that the length of asset data:
|
||||
// 1. Must be at least 68 bytes (see table above)
|
||||
// 2. Must be a multiple of 32 (excluding the 4-byte selector)
|
||||
if or(lt(assetDataLength, 68), mod(sub(assetDataLength, 4), 32)) {
|
||||
// Revert with `Error("INVALID_ASSET_DATA_LENGTH")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x00000019494e56414c49445f41535345545f444154415f4c454e475448000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
// End of asset data in calldata
|
||||
// assetDataOffset
|
||||
// + 32 (assetData len)
|
||||
let assetDataEnd := add(assetDataOffset, add(assetDataLength, 32))
|
||||
if gt(assetDataEnd, calldatasize()) {
|
||||
// Revert with `Error("INVALID_ASSET_DATA_END")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x00000016494e56414c49445f41535345545f444154415f454e44000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
// In order to find the offset to `amounts`, we must add:
|
||||
// 4 (function selector)
|
||||
// + assetDataOffset
|
||||
// assetDataOffset
|
||||
// + 32 (assetData len)
|
||||
// + 4 (assetProxyId)
|
||||
let amountsOffset := calldataload(add(assetDataOffset, 40))
|
||||
let amountsOffset := calldataload(add(assetDataOffset, 36))
|
||||
|
||||
// In order to find the offset to `nestedAssetData`, we must add:
|
||||
// 4 (function selector)
|
||||
// + assetDataOffset
|
||||
// assetDataOffset
|
||||
// + 32 (assetData len)
|
||||
// + 4 (assetProxyId)
|
||||
// + 32 (amounts offset)
|
||||
let nestedAssetDataOffset := calldataload(add(assetDataOffset, 72))
|
||||
let nestedAssetDataOffset := calldataload(add(assetDataOffset, 68))
|
||||
|
||||
// In order to find the start of the `amounts` contents, we must add:
|
||||
// 4 (function selector)
|
||||
// + assetDataOffset
|
||||
// assetDataOffset
|
||||
// + 32 (assetData len)
|
||||
// + 4 (assetProxyId)
|
||||
// + amountsOffset
|
||||
// + 32 (amounts len)
|
||||
let amountsContentsStart := add(assetDataOffset, add(amountsOffset, 72))
|
||||
let amountsContentsStart := add(assetDataOffset, add(amountsOffset, 68))
|
||||
|
||||
// Load number of elements in `amounts`
|
||||
let amountsLen := calldataload(sub(amountsContentsStart, 32))
|
||||
|
||||
// In order to find the start of the `nestedAssetData` contents, we must add:
|
||||
// 4 (function selector)
|
||||
// + assetDataOffset
|
||||
// assetDataOffset
|
||||
// + 32 (assetData len)
|
||||
// + 4 (assetProxyId)
|
||||
// + nestedAssetDataOffset
|
||||
// + 32 (nestedAssetData len)
|
||||
let nestedAssetDataContentsStart := add(assetDataOffset, add(nestedAssetDataOffset, 72))
|
||||
let nestedAssetDataContentsStart := add(assetDataOffset, add(nestedAssetDataOffset, 68))
|
||||
|
||||
// Load number of elements in `nestedAssetData`
|
||||
let nestedAssetDataLen := calldataload(sub(nestedAssetDataContentsStart, 32))
|
||||
@@ -204,15 +228,20 @@ contract MultiAssetProxy is
|
||||
let nestedAssetDataElementOffset := calldataload(add(nestedAssetDataContentsStart, i))
|
||||
|
||||
// In order to find the start of the `nestedAssetData[i]` contents, we must add:
|
||||
// 4 (function selector)
|
||||
// + assetDataOffset
|
||||
// assetDataOffset
|
||||
// + 32 (assetData len)
|
||||
// + 4 (assetProxyId)
|
||||
// + nestedAssetDataOffset
|
||||
// + 32 (nestedAssetData len)
|
||||
// + nestedAssetDataElementOffset
|
||||
// + 32 (nestedAssetDataElement len)
|
||||
let nestedAssetDataElementContentsStart := add(assetDataOffset, add(nestedAssetDataOffset, add(nestedAssetDataElementOffset, 104)))
|
||||
let nestedAssetDataElementContentsStart := add(
|
||||
assetDataOffset,
|
||||
add(
|
||||
nestedAssetDataOffset,
|
||||
add(nestedAssetDataElementOffset, 100)
|
||||
)
|
||||
)
|
||||
|
||||
// Load length of `nestedAssetData[i]`
|
||||
let nestedAssetDataElementLenStart := sub(nestedAssetDataElementContentsStart, 32)
|
||||
|
||||
@@ -18,181 +18,57 @@
|
||||
|
||||
pragma solidity ^0.5.9;
|
||||
|
||||
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
|
||||
|
||||
|
||||
// solhint-disable no-unused-vars
|
||||
contract StaticCallProxy {
|
||||
|
||||
using LibBytes for bytes;
|
||||
|
||||
// Id of this proxy.
|
||||
bytes4 constant internal PROXY_ID = bytes4(keccak256("StaticCall(address,bytes,bytes32)"));
|
||||
|
||||
// solhint-disable-next-line payable-fallback
|
||||
function ()
|
||||
/// @dev Makes a staticcall to a target address and verifies that the data returned matches the expected return data.
|
||||
/// @param assetData Byte array encoded with staticCallTarget, staticCallData, and expectedCallResultHash
|
||||
/// @param from This value is ignored.
|
||||
/// @param to This value is ignored.
|
||||
/// @param amount This value is ignored.
|
||||
function transferFrom(
|
||||
bytes calldata assetData,
|
||||
address from,
|
||||
address to,
|
||||
uint256 amount
|
||||
)
|
||||
external
|
||||
view
|
||||
{
|
||||
assembly {
|
||||
// The first 4 bytes of calldata holds the function selector
|
||||
let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)
|
||||
// Decode params from `assetData`
|
||||
(
|
||||
address staticCallTarget,
|
||||
bytes memory staticCallData,
|
||||
bytes32 expectedReturnDataHash
|
||||
) = abi.decode(
|
||||
assetData.sliceDestructive(4, assetData.length),
|
||||
(address, bytes, bytes32)
|
||||
);
|
||||
|
||||
// `transferFrom` will be called with the following parameters:
|
||||
// assetData Encoded byte array.
|
||||
// from Address to transfer asset from.
|
||||
// to Address to transfer asset to.
|
||||
// amount Amount of asset to transfer.
|
||||
// bytes4(keccak256("transferFrom(bytes,address,address,uint256)")) = 0xa85e59e4
|
||||
if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {
|
||||
// Execute staticcall
|
||||
(bool success, bytes memory returnData) = staticCallTarget.staticcall(staticCallData);
|
||||
|
||||
// `transferFrom`.
|
||||
// The function is marked `external`, so no abi decoding is done for
|
||||
// us. Instead, we expect the `calldata` memory to contain the
|
||||
// following:
|
||||
//
|
||||
// | Area | Offset | Length | Contents |
|
||||
// |----------|--------|---------|-------------------------------------|
|
||||
// | Header | 0 | 4 | function selector |
|
||||
// | Params | | 4 * 32 | function parameters: |
|
||||
// | | 4 | | 1. offset to assetData (*) |
|
||||
// | | 36 | | 2. from |
|
||||
// | | 68 | | 3. to |
|
||||
// | | 100 | | 4. amount |
|
||||
// | Data | | | assetData: |
|
||||
// | | 132 | 32 | assetData Length |
|
||||
// | | 164 | ** | assetData Contents |
|
||||
//
|
||||
// (*): offset is computed from start of function parameters, so offset
|
||||
// by an additional 4 bytes in the calldata.
|
||||
//
|
||||
// (**): see table below to compute length of assetData Contents
|
||||
// (***): Note that the `from`, `to`, and `amount` params in calldata are ignored in this function.
|
||||
//
|
||||
// WARNING: The ABIv2 specification allows additional padding between
|
||||
// the Params and Data section. This will result in a larger
|
||||
// offset to assetData.
|
||||
|
||||
// Load offset to `assetData`
|
||||
let assetDataOffset := add(calldataload(4), 4)
|
||||
|
||||
// Validate length of `assetData`
|
||||
let assetDataLen := calldataload(assetDataOffset)
|
||||
if or(lt(assetDataLen, 100), mod(sub(assetDataLen, 4), 32)) {
|
||||
// Revert with `Error("INVALID_ASSET_DATA_LENGTH")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x00000019494e56414c49445f41535345545f444154415f4c454e475448000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
// Ensure that `assetData` ends inside of calldata
|
||||
let assetDataEnd := add(assetDataOffset, add(assetDataLen, 32))
|
||||
if gt(assetDataEnd, calldatasize()) {
|
||||
// Revert with `Error("INVALID_ASSET_DATA_END")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x00000016494e56414c49445f41535345545f444154415f454e44000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
// Asset data is encoded as follows:
|
||||
// | Area | Offset | Length | Contents |
|
||||
// |----------|-------------|---------|--------------------------------------|
|
||||
// | Header | 0 | 4 | assetProxyId |
|
||||
// | Params | | 4 * 32 | function parameters: |
|
||||
// | | 4 | | 1. address of callTarget |
|
||||
// | | 36 | | 2. offset to staticCallData (*) |
|
||||
// | | 68 | | 3. expected 32 byte hash of output |
|
||||
// | Data | | | staticCallData: |
|
||||
// | | 100 | 32 | 1. staticCallData Length |
|
||||
// | | 132 | a | 2. staticCallData Contents |
|
||||
|
||||
// In order to find the offset to `staticCallData`, we must add:
|
||||
// assetDataOffset
|
||||
// + 32 (assetData len)
|
||||
// + 4 (proxyId)
|
||||
// + 32 (callTarget)
|
||||
let paramsInAssetDataOffset := add(assetDataOffset, 36)
|
||||
let staticCallDataOffset := add(paramsInAssetDataOffset, calldataload(add(assetDataOffset, 68)))
|
||||
|
||||
// Load length of `staticCallData`
|
||||
let staticCallDataLen := calldataload(staticCallDataOffset)
|
||||
|
||||
// Ensure `staticCallData` does not begin to outside of `assetData`
|
||||
let staticCallDataBegin := add(staticCallDataOffset, 32)
|
||||
let staticCallDataEnd := add(staticCallDataBegin, staticCallDataLen)
|
||||
if gt(staticCallDataEnd, assetDataEnd) {
|
||||
// Revert with `Error("INVALID_STATIC_CALL_DATA_OFFSET")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000001f494e56414c49445f5354415449435f43414c4c5f444154415f4f4646)
|
||||
mstore(96, 0x5345540000000000000000000000000000000000000000000000000000000000)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
// Copy `staticCallData` into memory
|
||||
calldatacopy(
|
||||
0, // memory can be safely overwritten from beginning
|
||||
staticCallDataBegin, // start of `staticCallData`
|
||||
staticCallDataLen // copy the entire `staticCallData`
|
||||
)
|
||||
|
||||
// In order to find the offset to `callTarget`, we must add:
|
||||
// assetDataOffset
|
||||
// + 32 (assetData len)
|
||||
// + 4 (proxyId)
|
||||
let callTarget := and(
|
||||
calldataload(add(assetDataOffset, 36)),
|
||||
0x000000000000000000000000ffffffffffffffffffffffffffffffffffffffff
|
||||
)
|
||||
|
||||
// Perform `callTarget.staticcall(staticCallData)`
|
||||
let success := staticcall(
|
||||
gas, // forward all gas
|
||||
callTarget, // call address `callTarget`
|
||||
0, // pointer to start of input
|
||||
staticCallDataLen, // length of input
|
||||
0, // start of memory can be safely overwritten
|
||||
0 // don't copy output to memory
|
||||
)
|
||||
|
||||
// Copy entire output to start of memory
|
||||
let outputLen := returndatasize()
|
||||
returndatacopy(
|
||||
0, // copy to memory at 0
|
||||
0, // copy from return data at 0
|
||||
outputLen // copy all return data
|
||||
)
|
||||
|
||||
// Revert with reason given by `callTarget` if staticcall is unsuccessful
|
||||
if iszero(success) {
|
||||
revert(0, outputLen)
|
||||
}
|
||||
|
||||
// Calculate hash of output
|
||||
let callResultHash := keccak256(0, outputLen)
|
||||
|
||||
// In order to find the offset to `expectedCallResultHash`, we must add:
|
||||
// assetDataOffset
|
||||
// + 32 (assetData len)
|
||||
// + 4 (proxyId)
|
||||
// + 32 (callTarget)
|
||||
// + 32 (staticCallDataOffset)
|
||||
let expectedResultHash := calldataload(add(assetDataOffset, 100))
|
||||
|
||||
if sub(callResultHash, expectedResultHash) {
|
||||
// Revert with `Error("UNEXPECTED_STATIC_CALL_RESULT")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000001d554e45585045435445445f5354415449435f43414c4c5f524553554c)
|
||||
mstore(96, 0x5400000000000000000000000000000000000000000000000000000000000000)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
// Return if output matched expected output
|
||||
return(0, 0)
|
||||
// Revert with returned data if staticcall is unsuccessful
|
||||
if (!success) {
|
||||
assembly {
|
||||
revert(add(returnData, 32), mload(returnData))
|
||||
}
|
||||
|
||||
// Revert if undefined function is called
|
||||
revert(0, 0)
|
||||
}
|
||||
|
||||
// Revert if hash of return data is not as expected
|
||||
bytes32 returnDataHash = keccak256(returnData);
|
||||
require(
|
||||
expectedReturnDataHash == returnDataHash,
|
||||
"UNEXPECTED_STATIC_CALL_RESULT"
|
||||
);
|
||||
}
|
||||
|
||||
/// @dev Gets the proxy id associated with the proxy address.
|
||||
@@ -204,4 +80,4 @@ contract StaticCallProxy {
|
||||
{
|
||||
return PROXY_ID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,9 +21,8 @@ pragma solidity ^0.5.5;
|
||||
import "./IAuthorizable.sol";
|
||||
|
||||
|
||||
contract IAssetProxy is
|
||||
IAuthorizable
|
||||
{
|
||||
contract IAssetProxy {
|
||||
|
||||
/// @dev Transfers assets. Either succeeds or throws.
|
||||
/// @param assetData Byte array encoded for the respective asset proxy.
|
||||
/// @param from Address to transfer asset from.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-asset-proxy",
|
||||
"version": "2.2.0",
|
||||
"version": "2.2.3",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.1.0",
|
||||
"@0x/contracts-gen": "^1.0.10",
|
||||
"@0x/contracts-test-utils": "^3.1.8",
|
||||
"@0x/dev-utils": "^2.2.4",
|
||||
"@0x/sol-compiler": "^3.1.9",
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@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.1.1",
|
||||
"@0x/contracts-erc1155": "^1.1.7",
|
||||
"@0x/contracts-erc20": "^2.2.6",
|
||||
"@0x/contracts-erc721": "^2.1.7",
|
||||
"@0x/contracts-utils": "^3.1.7",
|
||||
"@0x/order-utils": "^8.2.0",
|
||||
"@0x/types": "^2.4.0",
|
||||
"@0x/typescript-typings": "^4.2.3",
|
||||
"@0x/utils": "^4.4.0",
|
||||
"@0x/web3-wrapper": "^6.0.7",
|
||||
"ethereum-types": "^2.1.3",
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-erc1155": "^1.1.10",
|
||||
"@0x/contracts-erc20": "^2.2.9",
|
||||
"@0x/contracts-erc721": "^2.1.10",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
||||
@@ -1077,7 +1077,7 @@ describe('ERC1155Proxy', () => {
|
||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||
//
|
||||
// We want to chan ge the offset to token ids to point outside the calldata.
|
||||
// We want to change the offset to token ids to point outside the calldata.
|
||||
const encodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000080';
|
||||
const badEncodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000180';
|
||||
const assetDataWithBadTokenIdsOffset = assetData.replace(
|
||||
@@ -1085,7 +1085,7 @@ describe('ERC1155Proxy', () => {
|
||||
badEncodedOffsetToTokenIds,
|
||||
);
|
||||
// execute transfer
|
||||
await expectTransactionFailedAsync(
|
||||
await expectTransactionFailedWithoutReasonAsync(
|
||||
erc1155ProxyWrapper.transferFromAsync(
|
||||
spender,
|
||||
receiverContract,
|
||||
@@ -1097,7 +1097,6 @@ describe('ERC1155Proxy', () => {
|
||||
authorized,
|
||||
assetDataWithBadTokenIdsOffset,
|
||||
),
|
||||
RevertReason.InvalidIdsOffset,
|
||||
);
|
||||
});
|
||||
it('should revert if an element of token ids lies to outside the bounds of calldata', async () => {
|
||||
@@ -1125,7 +1124,7 @@ describe('ERC1155Proxy', () => {
|
||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||
//
|
||||
// We want to chan ge the offset to token ids to the end of calldata.
|
||||
// We want to change the offset to token ids to the end of calldata.
|
||||
// Then we'll add an invalid length: we encode length of 2 but only add 1 element.
|
||||
const encodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000080';
|
||||
const newEcodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000140';
|
||||
@@ -1137,7 +1136,7 @@ describe('ERC1155Proxy', () => {
|
||||
const encodedTokenIdValues = '0000000000000000000000000000000000000000000000000000000000000001';
|
||||
const assetDataWithBadTokenIds = `${assetDataWithNewTokenIdsOffset}${encodedTokenIdsLength}${encodedTokenIdValues}`;
|
||||
// execute transfer
|
||||
await expectTransactionFailedAsync(
|
||||
await expectTransactionFailedWithoutReasonAsync(
|
||||
erc1155ProxyWrapper.transferFromAsync(
|
||||
spender,
|
||||
receiverContract,
|
||||
@@ -1149,7 +1148,6 @@ describe('ERC1155Proxy', () => {
|
||||
authorized,
|
||||
assetDataWithBadTokenIds,
|
||||
),
|
||||
RevertReason.InvalidIdsOffset,
|
||||
);
|
||||
});
|
||||
it('should revert token ids length overflows', async () => {
|
||||
@@ -1177,7 +1175,7 @@ describe('ERC1155Proxy', () => {
|
||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||
//
|
||||
// We want to chan ge the offset to token ids to point to the end of calldata
|
||||
// We want to change the offset to token ids to point to the end of calldata
|
||||
const encodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000080';
|
||||
const badEncodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000140';
|
||||
const assetDataWithBadTokenIdsOffset = assetData.replace(
|
||||
@@ -1189,7 +1187,7 @@ describe('ERC1155Proxy', () => {
|
||||
const buffer = '0'.repeat(64 * 10);
|
||||
const assetDataWithOverflow = `${assetDataWithBadTokenIdsOffset}${encodedIdsLengthOverflow}${buffer}`;
|
||||
// execute transfer
|
||||
await expectTransactionFailedAsync(
|
||||
await expectTransactionFailedWithoutReasonAsync(
|
||||
erc1155ProxyWrapper.transferFromAsync(
|
||||
spender,
|
||||
receiverContract,
|
||||
@@ -1201,7 +1199,6 @@ describe('ERC1155Proxy', () => {
|
||||
authorized,
|
||||
assetDataWithOverflow,
|
||||
),
|
||||
RevertReason.Uint256Overflow,
|
||||
);
|
||||
});
|
||||
it('should revert token values length overflows', async () => {
|
||||
@@ -1229,7 +1226,7 @@ describe('ERC1155Proxy', () => {
|
||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||
//
|
||||
// We want to chan ge the offset to token values to point to the end of calldata
|
||||
// We want to change the offset to token values to point to the end of calldata
|
||||
const encodedOffsetToTokenIds = '00000000000000000000000000000000000000000000000000000000000000c0';
|
||||
const badEncodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000140';
|
||||
const assetDataWithBadTokenIdsOffset = assetData.replace(
|
||||
@@ -1241,7 +1238,7 @@ describe('ERC1155Proxy', () => {
|
||||
const buffer = '0'.repeat(64 * 10);
|
||||
const assetDataWithOverflow = `${assetDataWithBadTokenIdsOffset}${encodedIdsLengthOverflow}${buffer}`;
|
||||
// execute transfer
|
||||
await expectTransactionFailedAsync(
|
||||
await expectTransactionFailedWithoutReasonAsync(
|
||||
erc1155ProxyWrapper.transferFromAsync(
|
||||
spender,
|
||||
receiverContract,
|
||||
@@ -1253,7 +1250,6 @@ describe('ERC1155Proxy', () => {
|
||||
authorized,
|
||||
assetDataWithOverflow,
|
||||
),
|
||||
RevertReason.Uint256Overflow,
|
||||
);
|
||||
});
|
||||
it('should revert token data length overflows', async () => {
|
||||
@@ -1281,7 +1277,7 @@ describe('ERC1155Proxy', () => {
|
||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||
//
|
||||
// We want to chan ge the offset to token ids to point to the end of calldata,
|
||||
// We want to change the offset to token ids to point to the end of calldata,
|
||||
// which we'll extend with a bad length.
|
||||
const encodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000100';
|
||||
const badEncodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000140';
|
||||
@@ -1294,7 +1290,7 @@ describe('ERC1155Proxy', () => {
|
||||
const buffer = '0'.repeat(64 * 10);
|
||||
const assetDataWithOverflow = `${assetDataWithBadTokenIdsOffset}${encodedIdsLengthOverflow}${buffer}`;
|
||||
// execute transfer
|
||||
await expectTransactionFailedAsync(
|
||||
await expectTransactionFailedWithoutReasonAsync(
|
||||
erc1155ProxyWrapper.transferFromAsync(
|
||||
spender,
|
||||
receiverContract,
|
||||
@@ -1306,7 +1302,6 @@ describe('ERC1155Proxy', () => {
|
||||
authorized,
|
||||
assetDataWithOverflow,
|
||||
),
|
||||
RevertReason.InvalidDataOffset,
|
||||
);
|
||||
});
|
||||
it('should revert if token values resolves to outside the bounds of calldata', async () => {
|
||||
@@ -1334,7 +1329,7 @@ describe('ERC1155Proxy', () => {
|
||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||
//
|
||||
// We want to chan ge the offset to token values to point outside the calldata.
|
||||
// We want to change the offset to token values to point outside the calldata.
|
||||
const encodedOffsetToTokenValues = '00000000000000000000000000000000000000000000000000000000000000c0';
|
||||
const badEncodedOffsetToTokenValues = '00000000000000000000000000000000000000000000000000000000000001c0';
|
||||
const assetDataWithBadTokenIdsOffset = assetData.replace(
|
||||
@@ -1342,7 +1337,7 @@ describe('ERC1155Proxy', () => {
|
||||
badEncodedOffsetToTokenValues,
|
||||
);
|
||||
// execute transfer
|
||||
await expectTransactionFailedAsync(
|
||||
await expectTransactionFailedWithoutReasonAsync(
|
||||
erc1155ProxyWrapper.transferFromAsync(
|
||||
spender,
|
||||
receiverContract,
|
||||
@@ -1354,7 +1349,6 @@ describe('ERC1155Proxy', () => {
|
||||
authorized,
|
||||
assetDataWithBadTokenIdsOffset,
|
||||
),
|
||||
RevertReason.InvalidValuesOffset,
|
||||
);
|
||||
});
|
||||
it('should revert if an element of token values lies to outside the bounds of calldata', async () => {
|
||||
@@ -1382,7 +1376,7 @@ describe('ERC1155Proxy', () => {
|
||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||
//
|
||||
// We want to chan ge the offset to token values to the end of calldata.
|
||||
// We want to change the offset to token values to the end of calldata.
|
||||
// Then we'll add an invalid length: we encode length of 2 but only add 1 element.
|
||||
const encodedOffsetToTokenValues = '00000000000000000000000000000000000000000000000000000000000000c0';
|
||||
const newEcodedOffsetToTokenValues = '0000000000000000000000000000000000000000000000000000000000000140';
|
||||
@@ -1394,7 +1388,7 @@ describe('ERC1155Proxy', () => {
|
||||
const encodedTokenValuesElements = '0000000000000000000000000000000000000000000000000000000000000001';
|
||||
const assetDataWithBadTokenIds = `${assetDataWithNewTokenValuesOffset}${encodedTokenValuesLength}${encodedTokenValuesElements}`;
|
||||
// execute transfer
|
||||
await expectTransactionFailedAsync(
|
||||
await expectTransactionFailedWithoutReasonAsync(
|
||||
erc1155ProxyWrapper.transferFromAsync(
|
||||
spender,
|
||||
receiverContract,
|
||||
@@ -1406,7 +1400,6 @@ describe('ERC1155Proxy', () => {
|
||||
authorized,
|
||||
assetDataWithBadTokenIds,
|
||||
),
|
||||
RevertReason.InvalidValuesOffset,
|
||||
);
|
||||
});
|
||||
it('should revert if token data resolves to outside the bounds of calldata', async () => {
|
||||
@@ -1434,7 +1427,7 @@ describe('ERC1155Proxy', () => {
|
||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||
//
|
||||
// We want to chan ge the offset to token data to point outside the calldata.
|
||||
// We want to change the offset to token data to point outside the calldata.
|
||||
const encodedOffsetToTokenData = '0000000000000000000000000000000000000000000000000000000000000100';
|
||||
const badEncodedOffsetToTokenData = '00000000000000000000000000000000000000000000000000000000000001c0';
|
||||
const assetDataWithBadTokenDataOffset = assetData.replace(
|
||||
@@ -1442,7 +1435,7 @@ describe('ERC1155Proxy', () => {
|
||||
badEncodedOffsetToTokenData,
|
||||
);
|
||||
// execute transfer
|
||||
await expectTransactionFailedAsync(
|
||||
await expectTransactionFailedWithoutReasonAsync(
|
||||
erc1155ProxyWrapper.transferFromAsync(
|
||||
spender,
|
||||
receiverContract,
|
||||
@@ -1454,7 +1447,6 @@ describe('ERC1155Proxy', () => {
|
||||
authorized,
|
||||
assetDataWithBadTokenDataOffset,
|
||||
),
|
||||
RevertReason.InvalidDataOffset,
|
||||
);
|
||||
});
|
||||
it('should revert if an element of token data lies to outside the bounds of calldata', async () => {
|
||||
@@ -1482,7 +1474,7 @@ describe('ERC1155Proxy', () => {
|
||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||
//
|
||||
// We want to chan ge the offset to token data to the end of calldata.
|
||||
// We want to change the offset to token data to the end of calldata.
|
||||
// Then we'll add an invalid length: we encode length of 33 but only add 32 elements.
|
||||
const encodedOffsetToTokenData = '0000000000000000000000000000000000000000000000000000000000000100';
|
||||
const newEcodedOffsetToTokenData = '0000000000000000000000000000000000000000000000000000000000000140';
|
||||
@@ -1494,7 +1486,7 @@ describe('ERC1155Proxy', () => {
|
||||
const encodedTokenDataElements = '0000000000000000000000000000000000000000000000000000000000000001';
|
||||
const assetDataWithBadTokenData = `${assetDataWithNewTokenDataOffset}${encodedTokenDataLength}${encodedTokenDataElements}`;
|
||||
// execute transfer
|
||||
await expectTransactionFailedAsync(
|
||||
await expectTransactionFailedWithoutReasonAsync(
|
||||
erc1155ProxyWrapper.transferFromAsync(
|
||||
spender,
|
||||
receiverContract,
|
||||
@@ -1506,7 +1498,6 @@ describe('ERC1155Proxy', () => {
|
||||
authorized,
|
||||
assetDataWithBadTokenData,
|
||||
),
|
||||
RevertReason.InvalidDataOffset,
|
||||
);
|
||||
});
|
||||
it('should revert if asset data lies outside the bounds of calldata', async () => {
|
||||
@@ -1536,9 +1527,8 @@ describe('ERC1155Proxy', () => {
|
||||
const invalidOffsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000180';
|
||||
const badTxData = txData.replace(offsetToAssetData, invalidOffsetToAssetData);
|
||||
// execute transfer
|
||||
await expectTransactionFailedAsync(
|
||||
await expectTransactionFailedWithoutReasonAsync(
|
||||
erc1155ProxyWrapper.transferFromRawAsync(badTxData, authorized),
|
||||
RevertReason.InvalidAssetDataLength,
|
||||
);
|
||||
});
|
||||
it('should revert if asset data lies outside the bounds of calldata', async () => {
|
||||
@@ -1570,39 +1560,8 @@ describe('ERC1155Proxy', () => {
|
||||
const newAssetData = '0000000000000000000000000000000000000000000000000000000000000304';
|
||||
const badTxData = `${txData.replace(offsetToAssetData, invalidOffsetToAssetData)}${newAssetData}`;
|
||||
// execute transfer
|
||||
await expectTransactionFailedAsync(
|
||||
await expectTransactionFailedWithoutReasonAsync(
|
||||
erc1155ProxyWrapper.transferFromRawAsync(badTxData, authorized),
|
||||
RevertReason.InvalidAssetDataEnd,
|
||||
);
|
||||
});
|
||||
it('should revert if length of assetData, excluding the selector, is not a multiple of 32', async () => {
|
||||
// setup test parameters
|
||||
const tokensToTransfer = fungibleTokens.slice(0, 1);
|
||||
const valuesToTransfer = [fungibleValueToTransferLarge];
|
||||
const valueMultiplier = valueMultiplierSmall;
|
||||
const erc1155ContractAddress = erc1155Wrapper.getContract().address;
|
||||
const assetData = assetDataUtils.encodeERC1155AssetData(
|
||||
erc1155ContractAddress,
|
||||
tokensToTransfer,
|
||||
valuesToTransfer,
|
||||
receiverCallbackData,
|
||||
);
|
||||
const extraData = '01';
|
||||
const assetDataWithExtraData = `${assetData}${extraData}`;
|
||||
// execute transfer
|
||||
await expectTransactionFailedAsync(
|
||||
erc1155ProxyWrapper.transferFromAsync(
|
||||
spender,
|
||||
receiverContract,
|
||||
erc1155Contract.address,
|
||||
tokensToTransfer,
|
||||
valuesToTransfer,
|
||||
valueMultiplier,
|
||||
receiverCallbackData,
|
||||
authorized,
|
||||
assetDataWithExtraData,
|
||||
),
|
||||
RevertReason.InvalidAssetDataLength,
|
||||
);
|
||||
});
|
||||
it('should revert if length of assetData is less than 132 bytes', async () => {
|
||||
@@ -1618,7 +1577,7 @@ describe('ERC1155Proxy', () => {
|
||||
const zeros96Bytes = '0'.repeat(188);
|
||||
const assetData131Bytes = `${AssetProxyId.ERC1155}${zeros96Bytes}`;
|
||||
// execute transfer
|
||||
await expectTransactionFailedAsync(
|
||||
await expectTransactionFailedWithoutReasonAsync(
|
||||
erc1155ProxyWrapper.transferFromAsync(
|
||||
spender,
|
||||
receiverContract,
|
||||
@@ -1630,7 +1589,6 @@ describe('ERC1155Proxy', () => {
|
||||
authorized,
|
||||
assetData131Bytes,
|
||||
),
|
||||
RevertReason.InvalidAssetDataLength,
|
||||
);
|
||||
});
|
||||
it('should transfer nothing if value is zero', async () => {
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
} from '@0x/contracts-test-utils';
|
||||
import { BlockchainLifecycle } from '@0x/dev-utils';
|
||||
import { assetDataUtils } from '@0x/order-utils';
|
||||
import { RevertReason } from '@0x/types';
|
||||
import { AssetProxyId, RevertReason } from '@0x/types';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import * as chai from 'chai';
|
||||
import { LogWithDecodedArgs } from 'ethereum-types';
|
||||
@@ -1329,7 +1329,7 @@ describe('Asset Transfer Proxies', () => {
|
||||
const erc721AssetData = assetDataUtils.encodeERC721AssetData(erc721TokenA.address, erc721AFromTokenId);
|
||||
const amounts = [erc20Amount, erc721Amount];
|
||||
const nestedAssetData = [erc20AssetData, erc721AssetData];
|
||||
const extraData = '0102030405060708';
|
||||
const extraData = '0102030405060708090001020304050607080900010203040506070809000102';
|
||||
const assetData = `${assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData)}${extraData}`;
|
||||
const data = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
|
||||
assetData,
|
||||
@@ -1624,6 +1624,120 @@ describe('Asset Transfer Proxies', () => {
|
||||
RevertReason.SenderNotAuthorized,
|
||||
);
|
||||
});
|
||||
it('should revert if asset data overflows beyond the bounds of calldata', async () => {
|
||||
const inputAmount = new BigNumber(1);
|
||||
const erc20Amount = new BigNumber(10);
|
||||
const erc20AssetData = assetDataUtils.encodeERC20AssetData(erc20TokenA.address);
|
||||
const erc721Amount = new BigNumber(1);
|
||||
const erc721AssetData = assetDataUtils.encodeERC721AssetData(erc721TokenA.address, erc721AFromTokenId);
|
||||
const amounts = [erc20Amount, erc721Amount];
|
||||
const nestedAssetData = [erc20AssetData, erc721AssetData];
|
||||
const assetData = assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData);
|
||||
const data = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
|
||||
assetData,
|
||||
fromAddress,
|
||||
toAddress,
|
||||
inputAmount,
|
||||
);
|
||||
// append asset data to end of tx data with a length of 0x300 bytes, which will extend past actual calldata.
|
||||
const offsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000080';
|
||||
const invalidOffsetToAssetData = '00000000000000000000000000000000000000000000000000000000000002a0';
|
||||
const newAssetData = '0000000000000000000000000000000000000000000000000000000000000304';
|
||||
const badData = `${data.replace(offsetToAssetData, invalidOffsetToAssetData)}${newAssetData}`;
|
||||
// execute transfer
|
||||
await expectTransactionFailedAsync(
|
||||
web3Wrapper.sendTransactionAsync({
|
||||
to: multiAssetProxy.address,
|
||||
data: badData,
|
||||
from: authorized,
|
||||
}),
|
||||
RevertReason.InvalidAssetDataEnd,
|
||||
);
|
||||
});
|
||||
it('should revert if asset data resolves to a location beyond the bounds of calldata', async () => {
|
||||
const inputAmount = new BigNumber(1);
|
||||
const erc20Amount = new BigNumber(10);
|
||||
const erc20AssetData = assetDataUtils.encodeERC20AssetData(erc20TokenA.address);
|
||||
const erc721Amount = new BigNumber(1);
|
||||
const erc721AssetData = assetDataUtils.encodeERC721AssetData(erc721TokenA.address, erc721AFromTokenId);
|
||||
const amounts = [erc20Amount, erc721Amount];
|
||||
const nestedAssetData = [erc20AssetData, erc721AssetData];
|
||||
const assetData = assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData);
|
||||
const data = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
|
||||
assetData,
|
||||
fromAddress,
|
||||
toAddress,
|
||||
inputAmount,
|
||||
);
|
||||
const offsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000080';
|
||||
const invalidOffsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000400';
|
||||
const badData = data.replace(offsetToAssetData, invalidOffsetToAssetData);
|
||||
// execute transfer
|
||||
// note that this triggers `InvalidAssetDataLength` because the length is zero, otherwise it would
|
||||
// trigger `InvalidAssetDataEnd`.
|
||||
await expectTransactionFailedAsync(
|
||||
web3Wrapper.sendTransactionAsync({
|
||||
to: multiAssetProxy.address,
|
||||
data: badData,
|
||||
from: authorized,
|
||||
}),
|
||||
RevertReason.InvalidAssetDataLength,
|
||||
);
|
||||
});
|
||||
it('should revert if length of assetData, excluding the selector, is not a multiple of 32', async () => {
|
||||
// setup test parameters
|
||||
const inputAmount = new BigNumber(1);
|
||||
const erc20Amount = new BigNumber(10);
|
||||
const erc20AssetData = assetDataUtils.encodeERC20AssetData(erc20TokenA.address);
|
||||
const erc721Amount = new BigNumber(1);
|
||||
const erc721AssetData = assetDataUtils.encodeERC721AssetData(erc721TokenA.address, erc721AFromTokenId);
|
||||
const amounts = [erc20Amount, erc721Amount];
|
||||
const nestedAssetData = [erc20AssetData, erc721AssetData];
|
||||
const assetData = assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData);
|
||||
const extraData = '01';
|
||||
const assetDataWithExtraData = `${assetData}${extraData}`;
|
||||
const badData = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
|
||||
assetDataWithExtraData,
|
||||
fromAddress,
|
||||
toAddress,
|
||||
inputAmount,
|
||||
);
|
||||
// execute transfer
|
||||
await expectTransactionFailedAsync(
|
||||
web3Wrapper.sendTransactionAsync({
|
||||
to: multiAssetProxy.address,
|
||||
data: badData,
|
||||
from: authorized,
|
||||
}),
|
||||
RevertReason.InvalidAssetDataLength,
|
||||
);
|
||||
});
|
||||
it('should revert if length of assetData is less than 68 bytes', async () => {
|
||||
// setup test parameters
|
||||
const inputAmount = new BigNumber(1);
|
||||
// we'll construct asset data that has a 4 byte selector plus
|
||||
// 32 byte payload. This results in asset data that is 36 bytes
|
||||
// long and will trigger the `invalid length` error.
|
||||
// we must be sure to use a # of bytes that is still %32
|
||||
// so that we know the error is not triggered by another check in the code.
|
||||
const zeros32Bytes = '0'.repeat(64);
|
||||
const assetData36Bytes = `${AssetProxyId.MultiAsset}${zeros32Bytes}`;
|
||||
const badData = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
|
||||
assetData36Bytes,
|
||||
fromAddress,
|
||||
toAddress,
|
||||
inputAmount,
|
||||
);
|
||||
// execute transfer
|
||||
await expectTransactionFailedAsync(
|
||||
web3Wrapper.sendTransactionAsync({
|
||||
to: multiAssetProxy.address,
|
||||
data: badData,
|
||||
from: authorized,
|
||||
}),
|
||||
RevertReason.InvalidAssetDataLength,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -95,26 +95,12 @@ describe('StaticCallProxy', () => {
|
||||
const invalidOffsetToAssetData = ethUtil.bufferToHex(paddedTxDataEndBuffer).slice(2);
|
||||
const newAssetData = '0000000000000000000000000000000000000000000000000000000000000304';
|
||||
const badTxData = `${txData.replace(offsetToAssetData, invalidOffsetToAssetData)}${newAssetData}`;
|
||||
await expectTransactionFailedAsync(
|
||||
await expectTransactionFailedWithoutReasonAsync(
|
||||
web3Wrapper.sendTransactionAsync({
|
||||
to: staticCallProxy.address,
|
||||
from: fromAddress,
|
||||
data: badTxData,
|
||||
}),
|
||||
RevertReason.InvalidAssetDataEnd,
|
||||
);
|
||||
});
|
||||
it('should revert if the length of assetData, excluding the proxyId, is not a multiple of 32', async () => {
|
||||
const staticCallData = staticCallTarget.noInputFunction.getABIEncodedTransactionData();
|
||||
const expectedResultHash = constants.KECCAK256_NULL;
|
||||
const assetData = `${assetDataUtils.encodeStaticCallAssetData(
|
||||
staticCallTarget.address,
|
||||
staticCallData,
|
||||
expectedResultHash,
|
||||
)}01`;
|
||||
await expectTransactionFailedAsync(
|
||||
staticCallProxy.transferFrom.sendTransactionAsync(assetData, fromAddress, toAddress, amount),
|
||||
RevertReason.InvalidAssetDataLength,
|
||||
);
|
||||
});
|
||||
it('should revert if the length of assetData is less than 100 bytes', async () => {
|
||||
@@ -125,9 +111,8 @@ describe('StaticCallProxy', () => {
|
||||
.slice(0, -128);
|
||||
const assetDataByteLen = (assetData.length - 2) / 2;
|
||||
expect((assetDataByteLen - 4) % 32).to.equal(0);
|
||||
await expectTransactionFailedAsync(
|
||||
await expectTransactionFailedWithoutReasonAsync(
|
||||
staticCallProxy.transferFrom.sendTransactionAsync(assetData, fromAddress, toAddress, amount),
|
||||
RevertReason.InvalidAssetDataLength,
|
||||
);
|
||||
});
|
||||
it('should revert if the offset to `staticCallData` points to outside of assetData', async () => {
|
||||
@@ -147,9 +132,8 @@ describe('StaticCallProxy', () => {
|
||||
offsetToStaticCallData,
|
||||
invalidOffsetToStaticCallData,
|
||||
)}${newStaticCallData}`;
|
||||
await expectTransactionFailedAsync(
|
||||
await expectTransactionFailedWithoutReasonAsync(
|
||||
staticCallProxy.transferFrom.sendTransactionAsync(badAssetData, fromAddress, toAddress, amount),
|
||||
RevertReason.InvalidStaticCallDataOffset,
|
||||
);
|
||||
});
|
||||
it('should revert if the callTarget attempts to write to state', async () => {
|
||||
@@ -191,7 +175,7 @@ describe('StaticCallProxy', () => {
|
||||
RevertReason.UnexpectedStaticCallResult,
|
||||
);
|
||||
});
|
||||
it('should be successful if a function call with no inputs is successful', async () => {
|
||||
it('should be successful if a function call with no inputs and no outputs is successful', async () => {
|
||||
const staticCallData = staticCallTarget.noInputFunction.getABIEncodedTransactionData();
|
||||
const expectedResultHash = constants.KECCAK256_NULL;
|
||||
const assetData = assetDataUtils.encodeStaticCallAssetData(
|
||||
@@ -201,6 +185,12 @@ describe('StaticCallProxy', () => {
|
||||
);
|
||||
await staticCallProxy.transferFrom.awaitTransactionSuccessAsync(assetData, fromAddress, toAddress, amount);
|
||||
});
|
||||
it('should be successful if the staticCallTarget is not a contract and no return value is expected', async () => {
|
||||
const staticCallData = '0x0102030405060708';
|
||||
const expectedResultHash = constants.KECCAK256_NULL;
|
||||
const assetData = assetDataUtils.encodeStaticCallAssetData(toAddress, staticCallData, expectedResultHash);
|
||||
await staticCallProxy.transferFrom.awaitTransactionSuccessAsync(assetData, fromAddress, toAddress, amount);
|
||||
});
|
||||
it('should be successful if a function call with one static input returns the correct value', async () => {
|
||||
const staticCallData = staticCallTarget.isOddNumber.getABIEncodedTransactionData(new BigNumber(1));
|
||||
const trueAsBuffer = ethUtil.toBuffer('0x0000000000000000000000000000000000000000000000000000000000000001');
|
||||
|
||||
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "2.0.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563193019,
|
||||
"version": "2.0.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563047529,
|
||||
"version": "2.0.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563006338,
|
||||
"version": "2.0.5",
|
||||
|
||||
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.8 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.7 - _July 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.6 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.5 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-coordinator",
|
||||
"version": "2.0.5",
|
||||
"version": "2.0.8",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.1.0",
|
||||
"@0x/contracts-gen": "^1.0.10",
|
||||
"@0x/contracts-test-utils": "^3.1.8",
|
||||
"@0x/dev-utils": "^2.2.4",
|
||||
"@0x/sol-compiler": "^3.1.9",
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@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.1.1",
|
||||
"@0x/contracts-asset-proxy": "^2.2.0",
|
||||
"@0x/contracts-erc20": "^2.2.6",
|
||||
"@0x/contracts-exchange": "^2.1.6",
|
||||
"@0x/contracts-exchange-libs": "^3.0.0",
|
||||
"@0x/contracts-utils": "^3.1.7",
|
||||
"@0x/order-utils": "^8.2.0",
|
||||
"@0x/types": "^2.4.0",
|
||||
"@0x/typescript-typings": "^4.2.3",
|
||||
"@0x/utils": "^4.4.0",
|
||||
"@0x/web3-wrapper": "^6.0.7",
|
||||
"ethereum-types": "^2.1.3",
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.3",
|
||||
"@0x/contracts-erc20": "^2.2.9",
|
||||
"@0x/contracts-exchange": "^2.1.9",
|
||||
"@0x/contracts-exchange-libs": "^3.0.3",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
||||
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "0.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563193019,
|
||||
"version": "0.0.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563047529,
|
||||
"version": "0.0.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563006338,
|
||||
"version": "0.0.2",
|
||||
|
||||
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.0.5 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.4 - _July 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.3 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.2 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-dev-utils",
|
||||
"version": "0.0.2",
|
||||
"version": "0.0.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,12 +47,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/dev-utils/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.1.0",
|
||||
"@0x/contract-wrappers": "^9.1.5",
|
||||
"@0x/contracts-gen": "^1.0.10",
|
||||
"@0x/contracts-test-utils": "^3.1.8",
|
||||
"@0x/dev-utils": "^2.2.4",
|
||||
"@0x/sol-compiler": "^3.1.9",
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contract-wrappers": "^9.1.8",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -69,20 +69,20 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.1",
|
||||
"@0x/contracts-asset-proxy": "^2.2.0",
|
||||
"@0x/contracts-erc1155": "^1.1.7",
|
||||
"@0x/contracts-erc20": "^2.2.6",
|
||||
"@0x/contracts-erc721": "^2.1.7",
|
||||
"@0x/contracts-exchange": "^2.1.6",
|
||||
"@0x/contracts-exchange-libs": "^3.0.0",
|
||||
"@0x/contracts-utils": "^3.1.7",
|
||||
"@0x/order-utils": "^8.2.0",
|
||||
"@0x/types": "^2.4.0",
|
||||
"@0x/typescript-typings": "^4.2.3",
|
||||
"@0x/utils": "^4.4.0",
|
||||
"@0x/web3-wrapper": "^6.0.7",
|
||||
"ethereum-types": "^2.1.3",
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.3",
|
||||
"@0x/contracts-erc1155": "^1.1.10",
|
||||
"@0x/contracts-erc20": "^2.2.9",
|
||||
"@0x/contracts-erc721": "^2.1.10",
|
||||
"@0x/contracts-exchange": "^2.1.9",
|
||||
"@0x/contracts-exchange-libs": "^3.0.3",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"ethereumjs-util": "^5.1.1"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "1.1.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563193019,
|
||||
"version": "1.1.9",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563047529,
|
||||
"version": "1.1.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563006338,
|
||||
"version": "1.1.7",
|
||||
|
||||
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.1.10 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.9 - _July 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.8 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.7 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc1155",
|
||||
"version": "1.1.7",
|
||||
"version": "1.1.10",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,10 +47,10 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.1.0",
|
||||
"@0x/contracts-gen": "^1.0.10",
|
||||
"@0x/dev-utils": "^2.2.4",
|
||||
"@0x/sol-compiler": "^3.1.9",
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -67,14 +67,14 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.1",
|
||||
"@0x/contracts-test-utils": "^3.1.8",
|
||||
"@0x/contracts-utils": "^3.1.7",
|
||||
"@0x/types": "^2.4.0",
|
||||
"@0x/typescript-typings": "^4.2.3",
|
||||
"@0x/utils": "^4.4.0",
|
||||
"@0x/web3-wrapper": "^6.0.7",
|
||||
"ethereum-types": "^2.1.3",
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "2.2.9",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563193019,
|
||||
"version": "2.2.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563047529,
|
||||
"version": "2.2.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563006338,
|
||||
"version": "2.2.6",
|
||||
|
||||
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.2.9 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.8 - _July 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.7 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.6 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc20",
|
||||
"version": "2.2.6",
|
||||
"version": "2.2.9",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.1.0",
|
||||
"@0x/contracts-gen": "^1.0.10",
|
||||
"@0x/contracts-test-utils": "^3.1.8",
|
||||
"@0x/dev-utils": "^2.2.4",
|
||||
"@0x/sol-compiler": "^3.1.9",
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@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.1.1",
|
||||
"@0x/contracts-utils": "^3.1.7",
|
||||
"@0x/types": "^2.4.0",
|
||||
"@0x/typescript-typings": "^4.2.3",
|
||||
"@0x/utils": "^4.4.0",
|
||||
"@0x/web3-wrapper": "^6.0.7",
|
||||
"ethereum-types": "^2.1.3",
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "2.1.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563193019,
|
||||
"version": "2.1.9",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563047529,
|
||||
"version": "2.1.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563006338,
|
||||
"version": "2.1.7",
|
||||
|
||||
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.10 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.9 - _July 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.8 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.7 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc721",
|
||||
"version": "2.1.7",
|
||||
"version": "2.1.10",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.1.0",
|
||||
"@0x/contracts-gen": "^1.0.10",
|
||||
"@0x/contracts-test-utils": "^3.1.8",
|
||||
"@0x/dev-utils": "^2.2.4",
|
||||
"@0x/sol-compiler": "^3.1.9",
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@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.1.1",
|
||||
"@0x/contracts-utils": "^3.1.7",
|
||||
"@0x/types": "^2.4.0",
|
||||
"@0x/typescript-typings": "^4.2.3",
|
||||
"@0x/utils": "^4.4.0",
|
||||
"@0x/web3-wrapper": "^6.0.7",
|
||||
"ethereum-types": "^2.1.3",
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "3.0.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563193019,
|
||||
"version": "3.0.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563047529,
|
||||
"version": "3.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563006338,
|
||||
"version": "3.0.4",
|
||||
|
||||
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.7 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.6 - _July 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.5 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.4 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange-forwarder",
|
||||
"version": "3.0.4",
|
||||
"version": "3.0.7",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -46,12 +46,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.1.0",
|
||||
"@0x/contract-wrappers": "^9.1.5",
|
||||
"@0x/contracts-gen": "^1.0.10",
|
||||
"@0x/contracts-test-utils": "^3.1.8",
|
||||
"@0x/dev-utils": "^2.2.4",
|
||||
"@0x/sol-compiler": "^3.1.9",
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contract-wrappers": "^9.1.8",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -68,19 +68,19 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.1",
|
||||
"@0x/contracts-asset-proxy": "^2.2.0",
|
||||
"@0x/contracts-erc20": "^2.2.6",
|
||||
"@0x/contracts-erc721": "^2.1.7",
|
||||
"@0x/contracts-exchange": "^2.1.6",
|
||||
"@0x/contracts-exchange-libs": "^3.0.0",
|
||||
"@0x/contracts-utils": "^3.1.7",
|
||||
"@0x/order-utils": "^8.2.0",
|
||||
"@0x/types": "^2.4.0",
|
||||
"@0x/typescript-typings": "^4.2.3",
|
||||
"@0x/utils": "^4.4.0",
|
||||
"@0x/web3-wrapper": "^6.0.7",
|
||||
"ethereum-types": "^2.1.3",
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.3",
|
||||
"@0x/contracts-erc20": "^2.2.9",
|
||||
"@0x/contracts-erc721": "^2.1.10",
|
||||
"@0x/contracts-exchange": "^2.1.9",
|
||||
"@0x/contracts-exchange-libs": "^3.0.3",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "3.0.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563193019,
|
||||
"version": "3.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563047529,
|
||||
"version": "3.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.0.0",
|
||||
"changes": [
|
||||
|
||||
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.3 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.2 - _July 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.1 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.0 - _July 13, 2019_
|
||||
|
||||
* Move `LibTransactionDecoder` to contracts/dev-utils package (#1848)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange-libs",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.3",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/libs/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.1.0",
|
||||
"@0x/contracts-gen": "^1.0.10",
|
||||
"@0x/contracts-test-utils": "^3.1.8",
|
||||
"@0x/dev-utils": "^2.2.4",
|
||||
"@0x/sol-compiler": "^3.1.9",
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@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.1.1",
|
||||
"@0x/contracts-utils": "^3.1.7",
|
||||
"@0x/order-utils": "^8.2.0",
|
||||
"@0x/types": "^2.4.0",
|
||||
"@0x/typescript-typings": "^4.2.3",
|
||||
"@0x/utils": "^4.4.0",
|
||||
"@0x/web3-wrapper": "^6.0.7",
|
||||
"ethereum-types": "^2.1.3",
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "2.1.9",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563193019,
|
||||
"version": "2.1.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563047529,
|
||||
"version": "2.1.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563006338,
|
||||
"version": "2.1.6",
|
||||
|
||||
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.9 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.8 - _July 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.7 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.6 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange",
|
||||
"version": "2.1.6",
|
||||
"version": "2.1.9",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.1.0",
|
||||
"@0x/contracts-gen": "^1.0.10",
|
||||
"@0x/contracts-test-utils": "^3.1.8",
|
||||
"@0x/dev-utils": "^2.2.4",
|
||||
"@0x/sol-compiler": "^3.1.9",
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -68,19 +68,19 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.1",
|
||||
"@0x/contracts-asset-proxy": "^2.2.0",
|
||||
"@0x/contracts-erc1155": "^1.1.7",
|
||||
"@0x/contracts-erc20": "^2.2.6",
|
||||
"@0x/contracts-erc721": "^2.1.7",
|
||||
"@0x/contracts-exchange-libs": "^3.0.0",
|
||||
"@0x/contracts-utils": "^3.1.7",
|
||||
"@0x/order-utils": "^8.2.0",
|
||||
"@0x/types": "^2.4.0",
|
||||
"@0x/typescript-typings": "^4.2.3",
|
||||
"@0x/utils": "^4.4.0",
|
||||
"@0x/web3-wrapper": "^6.0.7",
|
||||
"ethereum-types": "^2.1.3",
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.3",
|
||||
"@0x/contracts-erc1155": "^1.1.10",
|
||||
"@0x/contracts-erc20": "^2.2.9",
|
||||
"@0x/contracts-erc721": "^2.1.10",
|
||||
"@0x/contracts-exchange-libs": "^3.0.3",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
||||
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "4.0.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563193019,
|
||||
"version": "4.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563047529,
|
||||
"version": "4.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "4.0.0",
|
||||
"changes": [
|
||||
|
||||
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.0.3 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.0.2 - _July 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.0.1 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.0.0 - _July 13, 2019_
|
||||
|
||||
* Move `OrderValidator` to contracts/dev-utils package as `OrderValidationUtils` (#1848)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-extensions",
|
||||
"version": "4.0.0",
|
||||
"version": "4.0.3",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,12 +47,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.1.0",
|
||||
"@0x/contract-wrappers": "^9.1.5",
|
||||
"@0x/contracts-gen": "^1.0.10",
|
||||
"@0x/contracts-test-utils": "^3.1.8",
|
||||
"@0x/dev-utils": "^2.2.4",
|
||||
"@0x/sol-compiler": "^3.1.9",
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contract-wrappers": "^9.1.8",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -69,19 +69,19 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.1",
|
||||
"@0x/contracts-asset-proxy": "^2.2.0",
|
||||
"@0x/contracts-erc20": "^2.2.6",
|
||||
"@0x/contracts-erc721": "^2.1.7",
|
||||
"@0x/contracts-exchange": "^2.1.6",
|
||||
"@0x/contracts-exchange-libs": "^3.0.0",
|
||||
"@0x/contracts-utils": "^3.1.7",
|
||||
"@0x/order-utils": "^8.2.0",
|
||||
"@0x/types": "^2.4.0",
|
||||
"@0x/typescript-typings": "^4.2.3",
|
||||
"@0x/utils": "^4.4.0",
|
||||
"@0x/web3-wrapper": "^6.0.7",
|
||||
"ethereum-types": "^2.1.3",
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.3",
|
||||
"@0x/contracts-erc20": "^2.2.9",
|
||||
"@0x/contracts-erc721": "^2.1.10",
|
||||
"@0x/contracts-exchange": "^2.1.9",
|
||||
"@0x/contracts-exchange-libs": "^3.0.3",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "3.1.9",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563193019,
|
||||
"version": "3.1.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563047529,
|
||||
"version": "3.1.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563006338,
|
||||
"version": "3.1.6",
|
||||
|
||||
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.9 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.8 - _July 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.7 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.6 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-multisig",
|
||||
"version": "3.1.6",
|
||||
"version": "3.1.9",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/multisig/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.1.0",
|
||||
"@0x/contracts-gen": "^1.0.10",
|
||||
"@0x/contracts-test-utils": "^3.1.8",
|
||||
"@0x/dev-utils": "^2.2.4",
|
||||
"@0x/sol-compiler": "^3.1.9",
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -68,15 +68,15 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.1",
|
||||
"@0x/contracts-asset-proxy": "^2.2.0",
|
||||
"@0x/contracts-erc20": "^2.2.6",
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.3",
|
||||
"@0x/contracts-erc20": "^2.2.9",
|
||||
"@0x/contracts-utils": "2.0.1",
|
||||
"@0x/types": "^2.4.0",
|
||||
"@0x/typescript-typings": "^4.2.3",
|
||||
"@0x/utils": "^4.4.0",
|
||||
"@0x/web3-wrapper": "^6.0.7",
|
||||
"ethereum-types": "^2.1.3",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "3.1.11",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563193019,
|
||||
"version": "3.1.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563047529,
|
||||
"version": "3.1.9",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.1.8",
|
||||
"changes": [
|
||||
|
||||
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.11 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.10 - _July 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.9 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.8 - _July 13, 2019_
|
||||
|
||||
* Fixed false positives in `expectTransactionFailedAsync` and `expectContractCallFailedAsync` (#1852)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-test-utils",
|
||||
"version": "3.1.8",
|
||||
"version": "3.1.11",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -41,18 +41,18 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/dev-utils": "^2.2.4",
|
||||
"@0x/order-utils": "^8.2.0",
|
||||
"@0x/sol-compiler": "^3.1.9",
|
||||
"@0x/sol-coverage": "^3.0.6",
|
||||
"@0x/sol-profiler": "^3.1.8",
|
||||
"@0x/sol-trace": "^2.0.14",
|
||||
"@0x/subproviders": "^4.1.1",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/sol-coverage": "^3.0.7",
|
||||
"@0x/sol-profiler": "^3.1.9",
|
||||
"@0x/sol-trace": "^2.0.15",
|
||||
"@0x/subproviders": "^4.1.2",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@0x/types": "^2.4.0",
|
||||
"@0x/typescript-typings": "^4.2.3",
|
||||
"@0x/utils": "^4.4.0",
|
||||
"@0x/web3-wrapper": "^6.0.7",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/js-combinatorics": "^0.5.29",
|
||||
"@types/lodash": "4.14.104",
|
||||
@@ -62,7 +62,7 @@
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"ethereum-types": "^2.1.3",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"ethers": "~4.0.4",
|
||||
"js-combinatorics": "^0.5.3",
|
||||
|
||||
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "3.1.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563193019,
|
||||
"version": "3.1.9",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563047529,
|
||||
"version": "3.1.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563006338,
|
||||
"version": "3.1.7",
|
||||
|
||||
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.10 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.9 - _July 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.8 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.7 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-utils",
|
||||
"version": "3.1.7",
|
||||
"version": "3.1.10",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/utils/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.1.0",
|
||||
"@0x/contracts-gen": "^1.0.10",
|
||||
"@0x/contracts-test-utils": "^3.1.8",
|
||||
"@0x/dev-utils": "^2.2.4",
|
||||
"@0x/sol-compiler": "^3.1.9",
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
@@ -69,14 +69,14 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.1",
|
||||
"@0x/order-utils": "^8.2.0",
|
||||
"@0x/types": "^2.4.0",
|
||||
"@0x/typescript-typings": "^4.2.3",
|
||||
"@0x/utils": "^4.4.0",
|
||||
"@0x/web3-wrapper": "^6.0.7",
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"bn.js": "^4.11.8",
|
||||
"ethereum-types": "^2.1.3",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
"graceful-fs": "4.1.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x-lerna-fork/lerna": "3.0.0-beta.26",
|
||||
"@0x-lerna-fork/lerna": "3.16.7",
|
||||
"@0xproject/npm-cli-login": "^0.0.11",
|
||||
"async-child-process": "^1.1.1",
|
||||
"bundlewatch": "^0.2.1",
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
[
|
||||
{
|
||||
"version": "6.0.13",
|
||||
"changes": [
|
||||
{
|
||||
"note": "re-export new ethereum-types type, TupleDataItem",
|
||||
"pr": 1919
|
||||
}
|
||||
],
|
||||
"timestamp": 1563957393
|
||||
},
|
||||
{
|
||||
"timestamp": 1563193019,
|
||||
"version": "6.0.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563047529,
|
||||
"version": "6.0.11",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563006338,
|
||||
"version": "6.0.10",
|
||||
|
||||
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v6.0.13 - _July 24, 2019_
|
||||
|
||||
* re-export new ethereum-types type, TupleDataItem (#1919)
|
||||
|
||||
## v6.0.12 - _July 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v6.0.11 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v6.0.10 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "0x.js",
|
||||
"version": "6.0.10",
|
||||
"version": "6.0.13",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -43,10 +43,10 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen-wrappers": "^5.0.0",
|
||||
"@0x/contract-addresses": "^3.0.0",
|
||||
"@0x/dev-utils": "^2.2.4",
|
||||
"@0x/migrations": "^4.1.7",
|
||||
"@0x/abi-gen-wrappers": "^5.0.3",
|
||||
"@0x/contract-addresses": "^3.0.2",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/migrations": "^4.1.10",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^2.2.42",
|
||||
@@ -73,18 +73,18 @@
|
||||
"webpack": "^4.20.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/assert": "^2.1.0",
|
||||
"@0x/base-contract": "^5.1.1",
|
||||
"@0x/contract-wrappers": "^9.1.5",
|
||||
"@0x/order-utils": "^8.2.0",
|
||||
"@0x/order-watcher": "^4.0.12",
|
||||
"@0x/subproviders": "^4.1.1",
|
||||
"@0x/types": "^2.4.0",
|
||||
"@0x/typescript-typings": "^4.2.3",
|
||||
"@0x/utils": "^4.4.0",
|
||||
"@0x/web3-wrapper": "^6.0.7",
|
||||
"@0x/assert": "^2.1.1",
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contract-wrappers": "^9.1.8",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/order-watcher": "^4.0.15",
|
||||
"@0x/subproviders": "^4.1.2",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"@types/web3-provider-engine": "^14.0.0",
|
||||
"ethereum-types": "^2.1.3",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"ethers": "~4.0.4",
|
||||
"lodash": "^4.17.11",
|
||||
"web3-provider-engine": "14.0.6"
|
||||
|
||||
@@ -131,6 +131,7 @@ export {
|
||||
ConstructorAbi,
|
||||
FallbackAbi,
|
||||
DataItem,
|
||||
TupleDataItem,
|
||||
ConstructorStateMutability,
|
||||
StateMutability,
|
||||
Web3JsProvider,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
[
|
||||
{
|
||||
"version": "2.3.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Python: fix broken event handling",
|
||||
"pr": 1919
|
||||
},
|
||||
{
|
||||
"note": "Python: custom validator class support",
|
||||
"pr": 1919
|
||||
},
|
||||
{
|
||||
"note": "Python: linter fixes",
|
||||
"pr": 1919
|
||||
},
|
||||
{
|
||||
"note": "Python: normalize bytes parameters in wrapper methods",
|
||||
"pr": 1919
|
||||
}
|
||||
],
|
||||
"timestamp": 1563957393
|
||||
},
|
||||
{
|
||||
"timestamp": 1563006338,
|
||||
"version": "2.2.1",
|
||||
|
||||
@@ -5,6 +5,13 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.3.0 - _July 24, 2019_
|
||||
|
||||
* Python: fix broken event handling (#1919)
|
||||
* Python: custom validator class support (#1919)
|
||||
* Python: linter fixes (#1919)
|
||||
* Python: normalize bytes parameters in wrapper methods (#1919)
|
||||
|
||||
## v2.2.1 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
"""Generated wrapper for {{contractName}} Solidity contract."""
|
||||
|
||||
import json
|
||||
from typing import Optional, Tuple, Union
|
||||
# pylint: disable=too-many-arguments
|
||||
|
||||
import json
|
||||
from typing import ( # pylint: disable=unused-import
|
||||
Any,
|
||||
List,
|
||||
Optional,
|
||||
Tuple,
|
||||
Union,
|
||||
)
|
||||
|
||||
from mypy_extensions import TypedDict # pylint: disable=unused-import
|
||||
from hexbytes import HexBytes
|
||||
from web3.datastructures import AttributeDict
|
||||
from web3.providers.base import BaseProvider
|
||||
@@ -11,13 +20,55 @@ from zero_ex.contract_wrappers._base_contract_wrapper import BaseContractWrapper
|
||||
from zero_ex.contract_wrappers.tx_params import TxParams
|
||||
|
||||
|
||||
class {{contractName}}ValidatorBase:
|
||||
"""Base class for validating inputs to {{contractName}} methods."""
|
||||
def __init__(
|
||||
self,
|
||||
provider: BaseProvider,
|
||||
contract_address: str,
|
||||
private_key: str = None,
|
||||
):
|
||||
"""Initialize the instance."""
|
||||
|
||||
def assert_valid(
|
||||
self, method_name: str, parameter_name: str, argument_value: Any
|
||||
):
|
||||
"""Raise an exception if method input is not valid.
|
||||
|
||||
:param method_name: Name of the method whose input is to be validated.
|
||||
:param parameter_name: Name of the parameter whose input is to be
|
||||
validated.
|
||||
:param argument_value: Value of argument to parameter to be validated.
|
||||
"""
|
||||
|
||||
|
||||
# Try to import a custom validator class definition; if there isn't one,
|
||||
# declare one that we can instantiate for the default argument to the
|
||||
# constructor for {{contractName}} below.
|
||||
try:
|
||||
# both mypy and pylint complain about what we're doing here, but this
|
||||
# works just fine, so their messages have been disabled here.
|
||||
from . import ( # type: ignore # pylint: disable=import-self
|
||||
{{contractName}}Validator,
|
||||
)
|
||||
except ImportError:
|
||||
|
||||
class {{contractName}}Validator({{contractName}}ValidatorBase): # type: ignore
|
||||
"""No-op input validator."""
|
||||
|
||||
|
||||
{{tupleDefinitions ABIString}}
|
||||
|
||||
|
||||
# pylint: disable=too-many-public-methods
|
||||
class {{contractName}}(BaseContractWrapper):
|
||||
"""Wrapper class for {{contractName}} Solidity contract."""
|
||||
"""Wrapper class for {{contractName}} Solidity contract.{{docBytesIfNecessary ABIString}}"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
provider: BaseProvider,
|
||||
contract_address: str,
|
||||
validator: {{contractName}}Validator = None,
|
||||
private_key: str = None,
|
||||
):
|
||||
"""Get an instance of wrapper for smart contract.
|
||||
@@ -34,6 +85,11 @@ class {{contractName}}(BaseContractWrapper):
|
||||
private_key=private_key,
|
||||
)
|
||||
|
||||
if not validator:
|
||||
validator = {{contractName}}Validator(provider, contract_address, private_key)
|
||||
|
||||
self.validator = validator
|
||||
|
||||
def _get_contract_instance(self, token_address):
|
||||
"""Get an instance of the smart contract at a specific address.
|
||||
|
||||
@@ -55,3 +111,5 @@ class {{contractName}}(BaseContractWrapper):
|
||||
return json.loads(
|
||||
'{{{ABIString}}}' # noqa: E501 (line-too-long)
|
||||
)
|
||||
|
||||
# pylint: disable=too-many-lines
|
||||
|
||||
@@ -6,31 +6,44 @@
|
||||
{{^this.constant}}
|
||||
view_only: bool = False,
|
||||
{{/this.constant}}
|
||||
) ->{{#if outputs}}{{~> return_type outputs=outputs~}}{{else}} None{{/if}}:
|
||||
) -> {{> return_type outputs=outputs~}}:
|
||||
"""Execute underlying, same-named contract method.
|
||||
{{sanitizeDevdocDetails this.name this.devdoc.details 8}}
|
||||
{{#each this.devdoc.params}}
|
||||
:param {{@key}}: {{this}}
|
||||
{{/each}}
|
||||
{{#if this.constant}}
|
||||
{{#if this.devdoc.return}}:returns: {{this.devdoc.return}}{{/if}}
|
||||
{{else}}
|
||||
{{sanitizeDevdocDetails this.name this.devdoc.details 8}}{{~#if this.devdoc.params~}}{{#each this.devdoc.params}}
|
||||
{{makeParameterDocstringRole @key this 8}}{{/each}}{{/if}}
|
||||
:param tx_params: transaction parameters
|
||||
{{#if this.constant~}}
|
||||
{{#if this.devdoc.return}}
|
||||
{{makeReturnDocstringRole this.devdoc.return 8}}{{/if}}
|
||||
{{else}}
|
||||
:param view_only: whether to use transact() or call()
|
||||
|
||||
:returns: transaction hash
|
||||
:returns: if param `view_only`:code: is `True`:code:, then returns the
|
||||
value returned from the underlying function; else returns the
|
||||
transaction hash.
|
||||
{{/if}}
|
||||
"""
|
||||
{{#each this.inputs}}
|
||||
self.validator.assert_valid(
|
||||
method_name='{{../name}}',
|
||||
parameter_name='{{name}}',
|
||||
argument_value={{toPythonIdentifier name}},
|
||||
)
|
||||
{{#if (equal type 'address')}}
|
||||
{{this.name}} = self._validate_and_checksum_address({{this.name}})
|
||||
{{toPythonIdentifier this.name}} = self._validate_and_checksum_address({{toPythonIdentifier this.name}})
|
||||
{{else if (equal type 'uint256')}}
|
||||
# safeguard against fractional inputs
|
||||
{{this.name}} = int({{this.name}})
|
||||
{{toPythonIdentifier this.name}} = int({{toPythonIdentifier this.name}})
|
||||
{{else if (equal type 'bytes')}}
|
||||
{{toPythonIdentifier this.name}} = bytes.fromhex({{toPythonIdentifier this.name}}.decode("utf-8"))
|
||||
{{else if (equal type 'bytes[]')}}
|
||||
{{toPythonIdentifier this.name}} = [
|
||||
bytes.fromhex({{toPythonIdentifier this.name}}_element.decode("utf-8"))
|
||||
for {{toPythonIdentifier this.name}}_element in {{toPythonIdentifier this.name}}
|
||||
]
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
func = self._get_contract_instance(
|
||||
self._contract_address
|
||||
self.contract_address
|
||||
).functions.{{this.name}}(
|
||||
{{> params}}
|
||||
)
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
def get_{{languageSpecificName}}_event(
|
||||
self, token_address: str, tx_hash: Union[HexBytes, bytes]
|
||||
self, tx_hash: Union[HexBytes, bytes]
|
||||
) -> Tuple[AttributeDict]:
|
||||
"""Get log entry for {{name}} event.
|
||||
|
||||
:param tx_hash: hash of transaction emitting {{name}} event.
|
||||
{{makeEventParameterDocstringRole name 8}}
|
||||
"""
|
||||
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
|
||||
token_address = self._validate_and_checksum_address(token_address)
|
||||
return (
|
||||
self._get_contract_instance(token_address)
|
||||
self._get_contract_instance(self.contract_address)
|
||||
.events.{{name}}()
|
||||
.processReceipt(tx_receipt)
|
||||
)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{{#each inputs}}
|
||||
{{name}}{{#if @last}}{{else}},{{/if}}
|
||||
{{toPythonIdentifier name}}{{#if @last}}{{else}},{{/if}}
|
||||
{{/each}}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
{{#if this.constant}}
|
||||
{{~#if outputs~}}
|
||||
{{^if this.constant}}
|
||||
Union[
|
||||
{{~/if~}}
|
||||
{{#if outputs.length}}
|
||||
{{#singleReturnValue}}
|
||||
{{#returnType outputs.0.type outputs.0.components}}{{~/returnType~}}
|
||||
{{#returnType outputs.0.type outputs.0.components}}{{~/returnType~}}
|
||||
{{/singleReturnValue}}
|
||||
{{^singleReturnValue}}
|
||||
[{{#each outputs}}{{#returnType type components}}{{/returnType}}{{#unless @last}}, {{/unless}}{{/each}}]
|
||||
{{/singleReturnValue}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{^if this.constant}}
|
||||
Union[HexBytes, bytes]
|
||||
{{~/if~}}
|
||||
{{else}}None
|
||||
{{/if}}{{^if this.constant}}, Union[HexBytes, bytes]]{{/if~}}
|
||||
{{else}}{{#if this.constant}}None{{else}}Union[None, Union[HexBytes, bytes]]{{/if}}{{/if~}}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{{#each inputs}}
|
||||
{{name}}: {{#parameterType type components}}{{/parameterType}},
|
||||
{{toPythonIdentifier name}}: {{#parameterType type components}}{{/parameterType}},
|
||||
{{/each}}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/abi-gen-templates",
|
||||
"version": "2.2.1",
|
||||
"version": "2.3.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
{
|
||||
name: '{{name}}',
|
||||
type: '{{type}}',
|
||||
{{#if (isDefined indexed)}}indexed: {{indexed}},{{/if}}
|
||||
{{#if components}}
|
||||
type: '{{type}}',{{#if (isDefined indexed)}}
|
||||
indexed: {{indexed}},{{/if}}{{#if components}}
|
||||
components: [
|
||||
{{#each components}}
|
||||
{{> abi_type this}}
|
||||
{{/each}}
|
||||
]
|
||||
{{/if}}
|
||||
]{{/if}}
|
||||
},
|
||||
|
||||
@@ -15,7 +15,7 @@ async callAsync(
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as {{contractName}}Contract;
|
||||
const encodedData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> params inputs=inputs}}]);
|
||||
const encodedData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> normalized_params inputs=inputs}}]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -24,6 +24,8 @@ async callAsync(
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from ? callDataWithDefaults.from.toLowerCase() : callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('{{this.functionSignature}}');
|
||||
@@ -39,6 +41,6 @@ getABIEncodedTransactionData(
|
||||
{{#assertionType name type}}{{/assertionType}}
|
||||
{{/each}}
|
||||
const self = this as any as {{contractName}}Contract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> params inputs=inputs}}]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> normalized_params inputs=inputs}}]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{{#each inputs}}
|
||||
{{name}}{{#ifEquals 'address' type}}.toLowerCase(){{/ifEquals}}{{#if @last}}{{else}},{{/if}}
|
||||
{{/each}}
|
||||
@@ -7,7 +7,7 @@ public {{languageSpecificName}} = {
|
||||
{{#assertionType name type}}{{/assertionType}}
|
||||
{{/each}}
|
||||
const self = this as any as {{contractName}}Contract;
|
||||
const encodedData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> params inputs=inputs}}]);
|
||||
const encodedData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> normalized_params inputs=inputs}}]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -17,9 +17,13 @@ public {{languageSpecificName}} = {
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.{{languageSpecificName}}.estimateGasAsync.bind(
|
||||
self,
|
||||
{{> params inputs=inputs}}
|
||||
{{> normalized_params inputs=inputs}}
|
||||
),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -34,7 +38,7 @@ public {{languageSpecificName}} = {
|
||||
{{/each}}
|
||||
const self = this as any as {{contractName}}Contract;
|
||||
{{#if inputs}}
|
||||
const txHashPromise = self.{{languageSpecificName}}.sendTransactionAsync({{> params input=inputs}}, txData);
|
||||
const txHashPromise = self.{{languageSpecificName}}.sendTransactionAsync({{> normalized_params input=inputs}}, txData);
|
||||
{{else}}
|
||||
const txHashPromise = self.{{languageSpecificName}}.sendTransactionAsync(txData);
|
||||
{{/if}}
|
||||
@@ -58,7 +62,7 @@ public {{languageSpecificName}} = {
|
||||
{{#assertionType name type}}{{/assertionType}}
|
||||
{{/each}}
|
||||
const self = this as any as {{contractName}}Contract;
|
||||
const encodedData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> params inputs=inputs}}]);
|
||||
const encodedData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> normalized_params inputs=inputs}}]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -67,6 +71,10 @@ public {{languageSpecificName}} = {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
|
||||
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "5.0.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563193019,
|
||||
"version": "5.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563047529,
|
||||
"version": "5.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "5.0.0",
|
||||
"changes": [
|
||||
@@ -14,6 +41,10 @@
|
||||
"note": "Update wrappers to include parameter assertions",
|
||||
"pr": 1823
|
||||
},
|
||||
{
|
||||
"note": "Update wrappers to normalize address inputs to lowercase",
|
||||
"pr": 1951
|
||||
},
|
||||
{
|
||||
"note": "Update wrappers to include `getABIEncodedTransactionData` for view and pure functions",
|
||||
"pr": 1863
|
||||
|
||||
@@ -5,11 +5,24 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v5.0.3 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v5.0.2 - _July 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v5.0.1 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v5.0.0 - _July 13, 2019_
|
||||
|
||||
* Wrappers no longer require passing in the contract ABI at instantiation (#1883)
|
||||
* Contract addresses now re-exported from @0x/contract-addresses (#1883)
|
||||
* Update wrappers to include parameter assertions (#1823)
|
||||
* Update wrappers to normalize address inputs to lowercase (#1951)
|
||||
* Update wrappers to include `getABIEncodedTransactionData` for view and pure functions (#1863)
|
||||
|
||||
## v4.3.0 - _May 10, 2019_
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/abi-gen-wrappers",
|
||||
"version": "5.0.0",
|
||||
"version": "5.0.3",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -33,23 +33,23 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen-wrappers/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.1.0",
|
||||
"@0x/abi-gen-templates": "^2.2.1",
|
||||
"@0x/assert": "^2.1.0",
|
||||
"@0x/json-schemas": "^3.0.11",
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/abi-gen-templates": "^2.3.0",
|
||||
"@0x/assert": "^2.1.1",
|
||||
"@0x/json-schemas": "^3.1.11",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@0x/types": "^2.4.0",
|
||||
"@0x/utils": "^4.4.0",
|
||||
"@0x/web3-wrapper": "^6.0.7",
|
||||
"ethereum-types": "^2.1.3",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"ethers": "~4.0.4",
|
||||
"lodash": "^4.17.11",
|
||||
"shx": "^0.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.1",
|
||||
"@0x/contract-addresses": "^3.0.0",
|
||||
"@0x/contract-artifacts": "^2.0.1"
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contract-addresses": "^3.0.2",
|
||||
"@0x/contract-artifacts": "^2.0.2"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
||||
@@ -134,6 +134,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('owners(uint256)');
|
||||
@@ -153,7 +157,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
async sendTransactionAsync(owner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('owner', owner);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('removeOwner(address)', [owner]);
|
||||
const encodedData = self._strictEncodeArguments('removeOwner(address)', [owner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -161,8 +165,12 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.removeOwner.estimateGasAsync.bind(self, owner),
|
||||
self.removeOwner.estimateGasAsync.bind(self, owner.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -174,7 +182,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('owner', owner);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const txHashPromise = self.removeOwner.sendTransactionAsync(owner, txData);
|
||||
const txHashPromise = self.removeOwner.sendTransactionAsync(owner.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -190,7 +198,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
async estimateGasAsync(owner: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('owner', owner);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('removeOwner(address)', [owner]);
|
||||
const encodedData = self._strictEncodeArguments('removeOwner(address)', [owner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -199,6 +207,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -213,7 +225,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('removeOwner(address)', [owner]);
|
||||
const encodedData = self._strictEncodeArguments('removeOwner(address)', [owner.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -222,6 +234,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('removeOwner(address)');
|
||||
@@ -233,7 +249,9 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
getABIEncodedTransactionData(owner: string): string {
|
||||
assert.isString('owner', owner);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeOwner(address)', [owner]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeOwner(address)', [
|
||||
owner.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -251,6 +269,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.revokeConfirmation.estimateGasAsync.bind(self, transactionId),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -287,6 +309,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -314,6 +340,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('revokeConfirmation(uint256)');
|
||||
@@ -347,7 +377,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('isOwner(address)', [index_0]);
|
||||
const encodedData = self._strictEncodeArguments('isOwner(address)', [index_0.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -356,6 +386,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('isOwner(address)');
|
||||
@@ -367,7 +401,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
getABIEncodedTransactionData(index_0: string): string {
|
||||
assert.isString('index_0', index_0);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('isOwner(address)', [index_0]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('isOwner(address)', [index_0.toLowerCase()]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -389,7 +423,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('confirmations(uint256,address)', [index_0, index_1]);
|
||||
const encodedData = self._strictEncodeArguments('confirmations(uint256,address)', [
|
||||
index_0,
|
||||
index_1.toLowerCase(),
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -398,6 +435,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('confirmations(uint256,address)');
|
||||
@@ -412,7 +453,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('confirmations(uint256,address)', [
|
||||
index_0,
|
||||
index_1,
|
||||
index_1.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -433,6 +474,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.executeRemoveAuthorizedAddressAtIndex.estimateGasAsync.bind(self, transactionId),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -474,6 +519,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -503,6 +552,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('executeRemoveAuthorizedAddressAtIndex(uint256)');
|
||||
@@ -541,6 +594,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('secondsTimeLocked()');
|
||||
@@ -582,6 +639,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getTransactionCount(bool,bool)');
|
||||
@@ -611,7 +672,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isBoolean('isRegistered', isRegistered);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('registerAssetProxy(address,bool)', [
|
||||
assetProxyContract,
|
||||
assetProxyContract.toLowerCase(),
|
||||
isRegistered,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -621,8 +682,12 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.registerAssetProxy.estimateGasAsync.bind(self, assetProxyContract, isRegistered),
|
||||
self.registerAssetProxy.estimateGasAsync.bind(self, assetProxyContract.toLowerCase(), isRegistered),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -637,7 +702,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isBoolean('isRegistered', isRegistered);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const txHashPromise = self.registerAssetProxy.sendTransactionAsync(
|
||||
assetProxyContract,
|
||||
assetProxyContract.toLowerCase(),
|
||||
isRegistered,
|
||||
txData,
|
||||
);
|
||||
@@ -662,7 +727,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isBoolean('isRegistered', isRegistered);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('registerAssetProxy(address,bool)', [
|
||||
assetProxyContract,
|
||||
assetProxyContract.toLowerCase(),
|
||||
isRegistered,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -673,6 +738,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -694,7 +763,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
}
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('registerAssetProxy(address,bool)', [
|
||||
assetProxyContract,
|
||||
assetProxyContract.toLowerCase(),
|
||||
isRegistered,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -705,6 +774,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('registerAssetProxy(address,bool)');
|
||||
@@ -718,7 +791,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isBoolean('isRegistered', isRegistered);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('registerAssetProxy(address,bool)', [
|
||||
assetProxyContract,
|
||||
assetProxyContract.toLowerCase(),
|
||||
isRegistered,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -728,7 +801,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
async sendTransactionAsync(owner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('owner', owner);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('addOwner(address)', [owner]);
|
||||
const encodedData = self._strictEncodeArguments('addOwner(address)', [owner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -736,8 +809,12 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.addOwner.estimateGasAsync.bind(self, owner),
|
||||
self.addOwner.estimateGasAsync.bind(self, owner.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -749,7 +826,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('owner', owner);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const txHashPromise = self.addOwner.sendTransactionAsync(owner, txData);
|
||||
const txHashPromise = self.addOwner.sendTransactionAsync(owner.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -765,7 +842,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
async estimateGasAsync(owner: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('owner', owner);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('addOwner(address)', [owner]);
|
||||
const encodedData = self._strictEncodeArguments('addOwner(address)', [owner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -774,6 +851,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -788,7 +869,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('addOwner(address)', [owner]);
|
||||
const encodedData = self._strictEncodeArguments('addOwner(address)', [owner.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -797,6 +878,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('addOwner(address)');
|
||||
@@ -808,7 +893,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
getABIEncodedTransactionData(owner: string): string {
|
||||
assert.isString('owner', owner);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addOwner(address)', [owner]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addOwner(address)', [owner.toLowerCase()]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -837,6 +922,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('isConfirmed(uint256)');
|
||||
@@ -869,6 +958,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.changeTimeLock.estimateGasAsync.bind(self, _secondsTimeLocked),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -905,6 +998,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -932,6 +1029,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('changeTimeLock(uint256)');
|
||||
@@ -965,7 +1066,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('isAssetProxyRegistered(address)', [index_0]);
|
||||
const encodedData = self._strictEncodeArguments('isAssetProxyRegistered(address)', [index_0.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -974,6 +1075,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('isAssetProxyRegistered(address)');
|
||||
@@ -985,7 +1090,9 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
getABIEncodedTransactionData(index_0: string): string {
|
||||
assert.isString('index_0', index_0);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('isAssetProxyRegistered(address)', [index_0]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('isAssetProxyRegistered(address)', [
|
||||
index_0.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -1014,6 +1121,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getConfirmationCount(uint256)');
|
||||
@@ -1056,6 +1167,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transactions(uint256)');
|
||||
@@ -1091,6 +1206,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getOwners()');
|
||||
@@ -1141,6 +1260,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getTransactionIds(uint256,uint256,bool,bool)');
|
||||
@@ -1187,6 +1310,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getConfirmations(uint256)');
|
||||
@@ -1222,6 +1349,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transactionCount()');
|
||||
@@ -1250,6 +1381,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.changeRequirement.estimateGasAsync.bind(self, _required),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -1286,6 +1421,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -1313,6 +1452,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('changeRequirement(uint256)');
|
||||
@@ -1342,6 +1485,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.confirmTransaction.estimateGasAsync.bind(self, transactionId),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -1378,6 +1525,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -1405,6 +1556,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('confirmTransaction(uint256)');
|
||||
@@ -1434,7 +1589,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isString('data', data);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('submitTransaction(address,uint256,bytes)', [
|
||||
destination,
|
||||
destination.toLowerCase(),
|
||||
value,
|
||||
data,
|
||||
]);
|
||||
@@ -1445,8 +1600,12 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.submitTransaction.estimateGasAsync.bind(self, destination, value, data),
|
||||
self.submitTransaction.estimateGasAsync.bind(self, destination.toLowerCase(), value, data),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -1462,7 +1621,12 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isBigNumber('value', value);
|
||||
assert.isString('data', data);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const txHashPromise = self.submitTransaction.sendTransactionAsync(destination, value, data, txData);
|
||||
const txHashPromise = self.submitTransaction.sendTransactionAsync(
|
||||
destination.toLowerCase(),
|
||||
value,
|
||||
data,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -1486,7 +1650,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isString('data', data);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('submitTransaction(address,uint256,bytes)', [
|
||||
destination,
|
||||
destination.toLowerCase(),
|
||||
value,
|
||||
data,
|
||||
]);
|
||||
@@ -1498,6 +1662,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -1521,7 +1689,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
}
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('submitTransaction(address,uint256,bytes)', [
|
||||
destination,
|
||||
destination.toLowerCase(),
|
||||
value,
|
||||
data,
|
||||
]);
|
||||
@@ -1533,6 +1701,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('submitTransaction(address,uint256,bytes)');
|
||||
@@ -1547,7 +1719,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isString('data', data);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('submitTransaction(address,uint256,bytes)', [
|
||||
destination,
|
||||
destination.toLowerCase(),
|
||||
value,
|
||||
data,
|
||||
]);
|
||||
@@ -1579,6 +1751,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('confirmationTimes(uint256)');
|
||||
@@ -1614,6 +1790,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('MAX_OWNER_COUNT()');
|
||||
@@ -1648,6 +1828,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('required()');
|
||||
@@ -1671,7 +1855,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isString('owner', owner);
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('replaceOwner(address,address)', [owner, newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('replaceOwner(address,address)', [
|
||||
owner.toLowerCase(),
|
||||
newOwner.toLowerCase(),
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -1679,8 +1866,12 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.replaceOwner.estimateGasAsync.bind(self, owner, newOwner),
|
||||
self.replaceOwner.estimateGasAsync.bind(self, owner.toLowerCase(), newOwner.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -1694,7 +1885,11 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isString('owner', owner);
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const txHashPromise = self.replaceOwner.sendTransactionAsync(owner, newOwner, txData);
|
||||
const txHashPromise = self.replaceOwner.sendTransactionAsync(
|
||||
owner.toLowerCase(),
|
||||
newOwner.toLowerCase(),
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -1711,7 +1906,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isString('owner', owner);
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('replaceOwner(address,address)', [owner, newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('replaceOwner(address,address)', [
|
||||
owner.toLowerCase(),
|
||||
newOwner.toLowerCase(),
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -1720,6 +1918,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -1740,7 +1942,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const encodedData = self._strictEncodeArguments('replaceOwner(address,address)', [owner, newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('replaceOwner(address,address)', [
|
||||
owner.toLowerCase(),
|
||||
newOwner.toLowerCase(),
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -1749,6 +1954,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('replaceOwner(address,address)');
|
||||
@@ -1762,8 +1971,8 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as AssetProxyOwnerContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('replaceOwner(address,address)', [
|
||||
owner,
|
||||
newOwner,
|
||||
owner.toLowerCase(),
|
||||
newOwner.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -1782,6 +1991,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.executeTransaction.estimateGasAsync.bind(self, transactionId),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -1818,6 +2031,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -1845,6 +2062,10 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('executeTransaction(uint256)');
|
||||
|
||||
@@ -54,6 +54,10 @@ export class CoordinatorContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getSignerAddress(bytes32,bytes)');
|
||||
@@ -99,6 +103,10 @@ export class CoordinatorContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getTransactionHash((uint256,address,bytes))');
|
||||
@@ -148,6 +156,10 @@ export class CoordinatorContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getCoordinatorApprovalHash((address,bytes32,bytes,uint256))');
|
||||
@@ -186,7 +198,13 @@ export class CoordinatorContract extends BaseContract {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
[transaction, txOrigin, transactionSignature, approvalExpirationTimeSeconds, approvalSignatures],
|
||||
[
|
||||
transaction,
|
||||
txOrigin.toLowerCase(),
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures,
|
||||
],
|
||||
);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -198,12 +216,16 @@ export class CoordinatorContract extends BaseContract {
|
||||
self.executeTransaction.estimateGasAsync.bind(
|
||||
self,
|
||||
transaction,
|
||||
txOrigin,
|
||||
txOrigin.toLowerCase(),
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures,
|
||||
),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -224,7 +246,7 @@ export class CoordinatorContract extends BaseContract {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const txHashPromise = self.executeTransaction.sendTransactionAsync(
|
||||
transaction,
|
||||
txOrigin,
|
||||
txOrigin.toLowerCase(),
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures,
|
||||
@@ -257,7 +279,13 @@ export class CoordinatorContract extends BaseContract {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
[transaction, txOrigin, transactionSignature, approvalExpirationTimeSeconds, approvalSignatures],
|
||||
[
|
||||
transaction,
|
||||
txOrigin.toLowerCase(),
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures,
|
||||
],
|
||||
);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -267,6 +295,10 @@ export class CoordinatorContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -294,7 +326,13 @@ export class CoordinatorContract extends BaseContract {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
[transaction, txOrigin, transactionSignature, approvalExpirationTimeSeconds, approvalSignatures],
|
||||
[
|
||||
transaction,
|
||||
txOrigin.toLowerCase(),
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures,
|
||||
],
|
||||
);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -304,6 +342,10 @@ export class CoordinatorContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
@@ -328,7 +370,13 @@ export class CoordinatorContract extends BaseContract {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
[transaction, txOrigin, transactionSignature, approvalExpirationTimeSeconds, approvalSignatures],
|
||||
[
|
||||
transaction,
|
||||
txOrigin.toLowerCase(),
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures,
|
||||
],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -353,6 +401,10 @@ export class CoordinatorContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('EIP712_EXCHANGE_DOMAIN_HASH()');
|
||||
@@ -392,7 +444,13 @@ export class CoordinatorContract extends BaseContract {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'assertValidCoordinatorApprovals((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
[transaction, txOrigin, transactionSignature, approvalExpirationTimeSeconds, approvalSignatures],
|
||||
[
|
||||
transaction,
|
||||
txOrigin.toLowerCase(),
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures,
|
||||
],
|
||||
);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -402,6 +460,10 @@ export class CoordinatorContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
@@ -426,7 +488,13 @@ export class CoordinatorContract extends BaseContract {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'assertValidCoordinatorApprovals((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
[transaction, txOrigin, transactionSignature, approvalExpirationTimeSeconds, approvalSignatures],
|
||||
[
|
||||
transaction,
|
||||
txOrigin.toLowerCase(),
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures,
|
||||
],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -471,6 +539,10 @@ export class CoordinatorContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('decodeOrdersFromFillData(bytes)');
|
||||
@@ -521,6 +593,10 @@ export class CoordinatorContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('EIP712_COORDINATOR_DOMAIN_HASH()');
|
||||
@@ -626,7 +702,6 @@ export class CoordinatorContract extends BaseContract {
|
||||
{
|
||||
name: 'transaction',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'salt',
|
||||
@@ -660,7 +735,6 @@ export class CoordinatorContract extends BaseContract {
|
||||
{
|
||||
name: 'approval',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'txOrigin',
|
||||
@@ -698,7 +772,6 @@ export class CoordinatorContract extends BaseContract {
|
||||
{
|
||||
name: 'transaction',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'salt',
|
||||
@@ -757,7 +830,6 @@ export class CoordinatorContract extends BaseContract {
|
||||
{
|
||||
name: 'transaction',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'salt',
|
||||
@@ -809,7 +881,6 @@ export class CoordinatorContract extends BaseContract {
|
||||
{
|
||||
name: 'orders',
|
||||
type: 'tuple[]',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAddress',
|
||||
|
||||
@@ -52,6 +52,10 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.setCoordinatorEndpoint.estimateGasAsync.bind(self, coordinatorEndpoint),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -88,6 +92,10 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -115,6 +123,10 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('setCoordinatorEndpoint(string)');
|
||||
@@ -148,7 +160,9 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as CoordinatorRegistryContract;
|
||||
const encodedData = self._strictEncodeArguments('getCoordinatorEndpoint(address)', [coordinatorOperator]);
|
||||
const encodedData = self._strictEncodeArguments('getCoordinatorEndpoint(address)', [
|
||||
coordinatorOperator.toLowerCase(),
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -157,6 +171,10 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getCoordinatorEndpoint(address)');
|
||||
@@ -169,7 +187,7 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
assert.isString('coordinatorOperator', coordinatorOperator);
|
||||
const self = (this as any) as CoordinatorRegistryContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getCoordinatorEndpoint(address)', [
|
||||
coordinatorOperator,
|
||||
coordinatorOperator.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
|
||||
@@ -66,6 +66,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('name()');
|
||||
@@ -89,7 +93,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_spender.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -97,8 +104,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.approve.estimateGasAsync.bind(self, _spender, _value),
|
||||
self.approve.estimateGasAsync.bind(self, _spender.toLowerCase(), _value),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -112,7 +123,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_spender, _value, txData);
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_spender.toLowerCase(), _value, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -133,7 +144,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_spender.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -142,6 +156,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -162,7 +180,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_spender.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -171,6 +192,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
@@ -184,7 +209,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_spender,
|
||||
_spender.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -210,6 +235,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
|
||||
@@ -236,8 +265,8 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -247,8 +276,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferFrom.estimateGasAsync.bind(self, _from, _to, _value),
|
||||
self.transferFrom.estimateGasAsync.bind(self, _from.toLowerCase(), _to.toLowerCase(), _value),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -264,7 +297,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(_from, _to, _value, txData);
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -288,8 +326,8 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -300,6 +338,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -323,8 +365,8 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
}
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -335,6 +377,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
@@ -349,8 +395,8 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -376,6 +422,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('decimals()');
|
||||
@@ -406,7 +456,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner]);
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -415,6 +465,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
@@ -426,7 +480,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
getABIEncodedTransactionData(_owner: string): string {
|
||||
assert.isString('_owner', _owner);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner.toLowerCase()]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -450,6 +504,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
@@ -484,6 +542,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('symbol()');
|
||||
@@ -512,6 +574,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.mint.estimateGasAsync.bind(self, _value),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -548,6 +614,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -571,6 +641,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('mint(uint256)');
|
||||
@@ -595,7 +669,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to.toLowerCase(), _value]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -603,8 +677,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transfer.estimateGasAsync.bind(self, _to, _value),
|
||||
self.transfer.estimateGasAsync.bind(self, _to.toLowerCase(), _value),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -618,7 +696,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const txHashPromise = self.transfer.sendTransactionAsync(_to, _value, txData);
|
||||
const txHashPromise = self.transfer.sendTransactionAsync(_to.toLowerCase(), _value, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -635,7 +713,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to.toLowerCase(), _value]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -644,6 +722,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -664,7 +746,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to.toLowerCase(), _value]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -673,6 +755,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
|
||||
@@ -685,7 +771,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -707,7 +796,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('allowance(address,address)', [_owner, _spender]);
|
||||
const encodedData = self._strictEncodeArguments('allowance(address,address)', [
|
||||
_owner.toLowerCase(),
|
||||
_spender.toLowerCase(),
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -716,6 +808,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
|
||||
@@ -729,8 +825,8 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isString('_spender', _spender);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('allowance(address,address)', [
|
||||
_owner,
|
||||
_spender,
|
||||
_owner.toLowerCase(),
|
||||
_spender.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -744,7 +840,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isString('_target', _target);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('setBalance(address,uint256)', [_target, _value]);
|
||||
const encodedData = self._strictEncodeArguments('setBalance(address,uint256)', [
|
||||
_target.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -752,8 +851,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.setBalance.estimateGasAsync.bind(self, _target, _value),
|
||||
self.setBalance.estimateGasAsync.bind(self, _target.toLowerCase(), _value),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -767,7 +870,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isString('_target', _target);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const txHashPromise = self.setBalance.sendTransactionAsync(_target, _value, txData);
|
||||
const txHashPromise = self.setBalance.sendTransactionAsync(_target.toLowerCase(), _value, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -788,7 +891,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isString('_target', _target);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('setBalance(address,uint256)', [_target, _value]);
|
||||
const encodedData = self._strictEncodeArguments('setBalance(address,uint256)', [
|
||||
_target.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -797,6 +903,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -817,7 +927,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('setBalance(address,uint256)', [_target, _value]);
|
||||
const encodedData = self._strictEncodeArguments('setBalance(address,uint256)', [
|
||||
_target.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -826,6 +939,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('setBalance(address,uint256)');
|
||||
@@ -839,7 +956,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('setBalance(address,uint256)', [
|
||||
_target,
|
||||
_target.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -849,7 +966,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
async sendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -857,8 +974,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferOwnership.estimateGasAsync.bind(self, newOwner),
|
||||
self.transferOwnership.estimateGasAsync.bind(self, newOwner.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -870,7 +991,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner, txData);
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -886,7 +1007,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
async estimateGasAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -895,6 +1016,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -909,7 +1034,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -918,6 +1043,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
@@ -929,7 +1058,9 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
getABIEncodedTransactionData(newOwner: string): string {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [
|
||||
newOwner.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -953,6 +1084,10 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('MAX_MINT_AMOUNT()');
|
||||
|
||||
@@ -76,6 +76,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('name()');
|
||||
@@ -115,6 +119,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getApproved(uint256)');
|
||||
@@ -139,7 +147,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_approved', _approved);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved, _tokenId]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_approved.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -147,8 +158,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.approve.estimateGasAsync.bind(self, _approved, _tokenId),
|
||||
self.approve.estimateGasAsync.bind(self, _approved.toLowerCase(), _tokenId),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -162,7 +177,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_approved', _approved);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_approved, _tokenId, txData);
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_approved.toLowerCase(), _tokenId, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -183,7 +198,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_approved', _approved);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved, _tokenId]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_approved.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -192,6 +210,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -212,7 +234,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved, _tokenId]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_approved.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -221,6 +246,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
@@ -234,7 +263,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_approved,
|
||||
_approved.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -252,8 +281,8 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -263,8 +292,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferFrom.estimateGasAsync.bind(self, _from, _to, _tokenId),
|
||||
self.transferFrom.estimateGasAsync.bind(self, _from.toLowerCase(), _to.toLowerCase(), _tokenId),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -280,7 +313,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(_from, _to, _tokenId, txData);
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -304,8 +342,8 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -316,6 +354,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -339,8 +381,8 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
}
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -351,6 +393,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
@@ -365,8 +411,8 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -381,7 +427,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('mint(address,uint256)', [_to, _tokenId]);
|
||||
const encodedData = self._strictEncodeArguments('mint(address,uint256)', [_to.toLowerCase(), _tokenId]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -389,8 +435,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.mint.estimateGasAsync.bind(self, _to, _tokenId),
|
||||
self.mint.estimateGasAsync.bind(self, _to.toLowerCase(), _tokenId),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -404,7 +454,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const txHashPromise = self.mint.sendTransactionAsync(_to, _tokenId, txData);
|
||||
const txHashPromise = self.mint.sendTransactionAsync(_to.toLowerCase(), _tokenId, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -425,7 +475,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('mint(address,uint256)', [_to, _tokenId]);
|
||||
const encodedData = self._strictEncodeArguments('mint(address,uint256)', [_to.toLowerCase(), _tokenId]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -434,6 +484,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -454,7 +508,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('mint(address,uint256)', [_to, _tokenId]);
|
||||
const encodedData = self._strictEncodeArguments('mint(address,uint256)', [_to.toLowerCase(), _tokenId]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -463,6 +517,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('mint(address,uint256)');
|
||||
@@ -475,7 +533,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('mint(address,uint256)', [_to, _tokenId]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('mint(address,uint256)', [
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -491,8 +552,8 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -502,8 +563,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.safeTransferFrom1.estimateGasAsync.bind(self, _from, _to, _tokenId),
|
||||
self.safeTransferFrom1.estimateGasAsync.bind(self, _from.toLowerCase(), _to.toLowerCase(), _tokenId),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -519,7 +584,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const txHashPromise = self.safeTransferFrom1.sendTransactionAsync(_from, _to, _tokenId, txData);
|
||||
const txHashPromise = self.safeTransferFrom1.sendTransactionAsync(
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -543,8 +613,8 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -555,6 +625,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -578,8 +652,8 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
}
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -590,6 +664,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('safeTransferFrom(address,address,uint256)');
|
||||
@@ -604,8 +682,8 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -636,6 +714,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('ownerOf(uint256)');
|
||||
@@ -667,7 +749,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner]);
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -676,6 +758,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
@@ -687,7 +773,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
getABIEncodedTransactionData(_owner: string): string {
|
||||
assert.isString('_owner', _owner);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner.toLowerCase()]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -711,6 +797,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
@@ -745,6 +835,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('symbol()');
|
||||
@@ -768,7 +862,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_owner', _owner);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('burn(address,uint256)', [_owner, _tokenId]);
|
||||
const encodedData = self._strictEncodeArguments('burn(address,uint256)', [_owner.toLowerCase(), _tokenId]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -776,8 +870,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.burn.estimateGasAsync.bind(self, _owner, _tokenId),
|
||||
self.burn.estimateGasAsync.bind(self, _owner.toLowerCase(), _tokenId),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -791,7 +889,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_owner', _owner);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const txHashPromise = self.burn.sendTransactionAsync(_owner, _tokenId, txData);
|
||||
const txHashPromise = self.burn.sendTransactionAsync(_owner.toLowerCase(), _tokenId, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -812,7 +910,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_owner', _owner);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('burn(address,uint256)', [_owner, _tokenId]);
|
||||
const encodedData = self._strictEncodeArguments('burn(address,uint256)', [_owner.toLowerCase(), _tokenId]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -821,6 +919,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -841,7 +943,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('burn(address,uint256)', [_owner, _tokenId]);
|
||||
const encodedData = self._strictEncodeArguments('burn(address,uint256)', [_owner.toLowerCase(), _tokenId]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -850,6 +952,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('burn(address,uint256)');
|
||||
@@ -862,7 +968,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_owner', _owner);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('burn(address,uint256)', [_owner, _tokenId]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('burn(address,uint256)', [
|
||||
_owner.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -875,7 +984,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_operator', _operator);
|
||||
assert.isBoolean('_approved', _approved);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator, _approved]);
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [
|
||||
_operator.toLowerCase(),
|
||||
_approved,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -883,8 +995,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.setApprovalForAll.estimateGasAsync.bind(self, _operator, _approved),
|
||||
self.setApprovalForAll.estimateGasAsync.bind(self, _operator.toLowerCase(), _approved),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -898,7 +1014,11 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_operator', _operator);
|
||||
assert.isBoolean('_approved', _approved);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const txHashPromise = self.setApprovalForAll.sendTransactionAsync(_operator, _approved, txData);
|
||||
const txHashPromise = self.setApprovalForAll.sendTransactionAsync(
|
||||
_operator.toLowerCase(),
|
||||
_approved,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -919,7 +1039,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_operator', _operator);
|
||||
assert.isBoolean('_approved', _approved);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator, _approved]);
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [
|
||||
_operator.toLowerCase(),
|
||||
_approved,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -928,6 +1051,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -948,7 +1075,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator, _approved]);
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [
|
||||
_operator.toLowerCase(),
|
||||
_approved,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -957,6 +1087,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('setApprovalForAll(address,bool)');
|
||||
@@ -970,7 +1104,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isBoolean('_approved', _approved);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [
|
||||
_operator,
|
||||
_operator.toLowerCase(),
|
||||
_approved,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -990,8 +1124,8 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_data', _data);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
_data,
|
||||
]);
|
||||
@@ -1002,8 +1136,18 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.safeTransferFrom2.estimateGasAsync.bind(self, _from, _to, _tokenId, _data),
|
||||
self.safeTransferFrom2.estimateGasAsync.bind(
|
||||
self,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
_data,
|
||||
),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -1021,7 +1165,13 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
assert.isString('_data', _data);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const txHashPromise = self.safeTransferFrom2.sendTransactionAsync(_from, _to, _tokenId, _data, txData);
|
||||
const txHashPromise = self.safeTransferFrom2.sendTransactionAsync(
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
_data,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -1047,8 +1197,8 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_data', _data);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
_data,
|
||||
]);
|
||||
@@ -1060,6 +1210,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -1085,8 +1239,8 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
}
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
_data,
|
||||
]);
|
||||
@@ -1098,6 +1252,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('safeTransferFrom(address,address,uint256,bytes)');
|
||||
@@ -1114,7 +1272,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'safeTransferFrom(address,address,uint256,bytes)',
|
||||
[_from, _to, _tokenId, _data],
|
||||
[_from.toLowerCase(), _to.toLowerCase(), _tokenId, _data],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -1137,7 +1295,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('isApprovedForAll(address,address)', [_owner, _operator]);
|
||||
const encodedData = self._strictEncodeArguments('isApprovedForAll(address,address)', [
|
||||
_owner.toLowerCase(),
|
||||
_operator.toLowerCase(),
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -1146,6 +1307,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('isApprovedForAll(address,address)');
|
||||
@@ -1159,8 +1324,8 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isString('_operator', _operator);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('isApprovedForAll(address,address)', [
|
||||
_owner,
|
||||
_operator,
|
||||
_owner.toLowerCase(),
|
||||
_operator.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -1169,7 +1334,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
async sendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -1177,8 +1342,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferOwnership.estimateGasAsync.bind(self, newOwner),
|
||||
self.transferOwnership.estimateGasAsync.bind(self, newOwner.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -1190,7 +1359,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner, txData);
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -1206,7 +1375,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
async estimateGasAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -1215,6 +1384,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -1229,7 +1402,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -1238,6 +1411,10 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
@@ -1249,7 +1426,9 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
getABIEncodedTransactionData(newOwner: string): string {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as DummyERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [
|
||||
newOwner.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -59,6 +59,10 @@ export class DutchAuctionContract extends BaseContract {
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.getAuctionDetails.estimateGasAsync.bind(self, order),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -125,6 +129,10 @@ export class DutchAuctionContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -174,6 +182,10 @@ export class DutchAuctionContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
@@ -263,6 +275,10 @@ export class DutchAuctionContract extends BaseContract {
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.matchOrders.estimateGasAsync.bind(self, buyOrder, sellOrder, buySignature, sellSignature),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -371,6 +387,10 @@ export class DutchAuctionContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -445,6 +465,10 @@ export class DutchAuctionContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
@@ -579,7 +603,6 @@ export class DutchAuctionContract extends BaseContract {
|
||||
{
|
||||
name: 'order',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAddress',
|
||||
@@ -637,7 +660,6 @@ export class DutchAuctionContract extends BaseContract {
|
||||
{
|
||||
name: 'auctionDetails',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'beginTimeSeconds',
|
||||
@@ -676,7 +698,6 @@ export class DutchAuctionContract extends BaseContract {
|
||||
{
|
||||
name: 'buyOrder',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAddress',
|
||||
@@ -731,7 +752,6 @@ export class DutchAuctionContract extends BaseContract {
|
||||
{
|
||||
name: 'sellOrder',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAddress',
|
||||
@@ -797,12 +817,10 @@ export class DutchAuctionContract extends BaseContract {
|
||||
{
|
||||
name: 'matchedFillResults',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'left',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAssetFilledAmount',
|
||||
@@ -825,7 +843,6 @@ export class DutchAuctionContract extends BaseContract {
|
||||
{
|
||||
name: 'right',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAssetFilledAmount',
|
||||
|
||||
@@ -50,7 +50,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -58,8 +58,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.addAuthorizedAddress.estimateGasAsync.bind(self, target),
|
||||
self.addAuthorizedAddress.estimateGasAsync.bind(self, target.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -71,7 +75,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -87,7 +91,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -96,6 +100,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -110,7 +118,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -119,6 +127,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
|
||||
@@ -130,7 +142,9 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [
|
||||
target.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -159,6 +173,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('authorities(uint256)');
|
||||
@@ -178,7 +196,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -186,8 +204,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.removeAuthorizedAddress.estimateGasAsync.bind(self, target),
|
||||
self.removeAuthorizedAddress.estimateGasAsync.bind(self, target.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -199,7 +221,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -215,7 +237,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -224,6 +246,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -238,7 +264,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -247,6 +273,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
|
||||
@@ -258,7 +288,9 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [
|
||||
target.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -282,6 +314,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
@@ -306,7 +342,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
assert.isBigNumber('index', index);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
target.toLowerCase(),
|
||||
index,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -316,8 +352,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.removeAuthorizedAddressAtIndex.estimateGasAsync.bind(self, target, index),
|
||||
self.removeAuthorizedAddressAtIndex.estimateGasAsync.bind(self, target.toLowerCase(), index),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -331,7 +371,11 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(target, index, txData);
|
||||
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(
|
||||
target.toLowerCase(),
|
||||
index,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -353,7 +397,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
assert.isBigNumber('index', index);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
target.toLowerCase(),
|
||||
index,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -364,6 +408,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -385,7 +433,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
}
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
target.toLowerCase(),
|
||||
index,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -396,6 +444,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
|
||||
@@ -410,7 +462,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'removeAuthorizedAddressAtIndex(address,uint256)',
|
||||
[target, index],
|
||||
[target.toLowerCase(), index],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -435,6 +487,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
||||
@@ -465,7 +521,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('authorized(address)', [index_0]);
|
||||
const encodedData = self._strictEncodeArguments('authorized(address)', [index_0.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -474,6 +530,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('authorized(address)');
|
||||
@@ -485,7 +545,9 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
getABIEncodedTransactionData(index_0: string): string {
|
||||
assert.isString('index_0', index_0);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('authorized(address)', [index_0]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('authorized(address)', [
|
||||
index_0.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -509,6 +571,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
|
||||
@@ -527,7 +593,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
async sendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -535,8 +601,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferOwnership.estimateGasAsync.bind(self, newOwner),
|
||||
self.transferOwnership.estimateGasAsync.bind(self, newOwner.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -548,7 +618,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner, txData);
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -564,7 +634,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
async estimateGasAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -573,6 +643,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -587,7 +661,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -596,6 +670,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
@@ -607,7 +685,9 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
getABIEncodedTransactionData(newOwner: string): string {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [
|
||||
newOwner.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -55,7 +55,10 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_spender.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -63,8 +66,12 @@ export class ERC20TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.approve.estimateGasAsync.bind(self, _spender, _value),
|
||||
self.approve.estimateGasAsync.bind(self, _spender.toLowerCase(), _value),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -78,7 +85,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_spender, _value, txData);
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_spender.toLowerCase(), _value, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -99,7 +106,10 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_spender.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -108,6 +118,10 @@ export class ERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -128,7 +142,10 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_spender.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -137,6 +154,10 @@ export class ERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
@@ -150,7 +171,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_spender,
|
||||
_spender.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -176,6 +197,10 @@ export class ERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
|
||||
@@ -202,8 +227,8 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -213,8 +238,12 @@ export class ERC20TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferFrom.estimateGasAsync.bind(self, _from, _to, _value),
|
||||
self.transferFrom.estimateGasAsync.bind(self, _from.toLowerCase(), _to.toLowerCase(), _value),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -230,7 +259,12 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(_from, _to, _value, txData);
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -254,8 +288,8 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -266,6 +300,10 @@ export class ERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -289,8 +327,8 @@ export class ERC20TokenContract extends BaseContract {
|
||||
}
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -301,6 +339,10 @@ export class ERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
@@ -315,8 +357,8 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -338,7 +380,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner]);
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -347,6 +389,10 @@ export class ERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
@@ -358,7 +404,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
getABIEncodedTransactionData(_owner: string): string {
|
||||
assert.isString('_owner', _owner);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner.toLowerCase()]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -371,7 +417,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to.toLowerCase(), _value]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -379,8 +425,12 @@ export class ERC20TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transfer.estimateGasAsync.bind(self, _to, _value),
|
||||
self.transfer.estimateGasAsync.bind(self, _to.toLowerCase(), _value),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -394,7 +444,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const txHashPromise = self.transfer.sendTransactionAsync(_to, _value, txData);
|
||||
const txHashPromise = self.transfer.sendTransactionAsync(_to.toLowerCase(), _value, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -411,7 +461,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to.toLowerCase(), _value]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -420,6 +470,10 @@ export class ERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -440,7 +494,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to.toLowerCase(), _value]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -449,6 +503,10 @@ export class ERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
|
||||
@@ -461,7 +519,10 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -483,7 +544,10 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('allowance(address,address)', [_owner, _spender]);
|
||||
const encodedData = self._strictEncodeArguments('allowance(address,address)', [
|
||||
_owner.toLowerCase(),
|
||||
_spender.toLowerCase(),
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -492,6 +556,10 @@ export class ERC20TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
|
||||
@@ -505,8 +573,8 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isString('_spender', _spender);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('allowance(address,address)', [
|
||||
_owner,
|
||||
_spender,
|
||||
_owner.toLowerCase(),
|
||||
_spender.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
|
||||
@@ -50,7 +50,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -58,8 +58,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.addAuthorizedAddress.estimateGasAsync.bind(self, target),
|
||||
self.addAuthorizedAddress.estimateGasAsync.bind(self, target.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -71,7 +75,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -87,7 +91,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -96,6 +100,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -110,7 +118,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -119,6 +127,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
|
||||
@@ -130,7 +142,9 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [
|
||||
target.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -159,6 +173,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('authorities(uint256)');
|
||||
@@ -178,7 +196,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -186,8 +204,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.removeAuthorizedAddress.estimateGasAsync.bind(self, target),
|
||||
self.removeAuthorizedAddress.estimateGasAsync.bind(self, target.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -199,7 +221,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -215,7 +237,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -224,6 +246,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -238,7 +264,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -247,6 +273,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
|
||||
@@ -258,7 +288,9 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [
|
||||
target.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -282,6 +314,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
@@ -306,7 +342,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
assert.isBigNumber('index', index);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
target.toLowerCase(),
|
||||
index,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -316,8 +352,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.removeAuthorizedAddressAtIndex.estimateGasAsync.bind(self, target, index),
|
||||
self.removeAuthorizedAddressAtIndex.estimateGasAsync.bind(self, target.toLowerCase(), index),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -331,7 +371,11 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(target, index, txData);
|
||||
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(
|
||||
target.toLowerCase(),
|
||||
index,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -353,7 +397,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
assert.isBigNumber('index', index);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
target.toLowerCase(),
|
||||
index,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -364,6 +408,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -385,7 +433,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
}
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
target.toLowerCase(),
|
||||
index,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -396,6 +444,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
|
||||
@@ -410,7 +462,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'removeAuthorizedAddressAtIndex(address,uint256)',
|
||||
[target, index],
|
||||
[target.toLowerCase(), index],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -435,6 +487,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
||||
@@ -465,7 +521,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('authorized(address)', [index_0]);
|
||||
const encodedData = self._strictEncodeArguments('authorized(address)', [index_0.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -474,6 +530,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('authorized(address)');
|
||||
@@ -485,7 +545,9 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
getABIEncodedTransactionData(index_0: string): string {
|
||||
assert.isString('index_0', index_0);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('authorized(address)', [index_0]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('authorized(address)', [
|
||||
index_0.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -509,6 +571,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
|
||||
@@ -527,7 +593,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
async sendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -535,8 +601,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferOwnership.estimateGasAsync.bind(self, newOwner),
|
||||
self.transferOwnership.estimateGasAsync.bind(self, newOwner.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -548,7 +618,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner, txData);
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -564,7 +634,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
async estimateGasAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -573,6 +643,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -587,7 +661,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -596,6 +670,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
@@ -607,7 +685,9 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
getABIEncodedTransactionData(newOwner: string): string {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [
|
||||
newOwner.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -81,6 +81,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getApproved(uint256)');
|
||||
@@ -105,7 +109,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isString('_approved', _approved);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved, _tokenId]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_approved.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -113,8 +120,12 @@ export class ERC721TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.approve.estimateGasAsync.bind(self, _approved, _tokenId),
|
||||
self.approve.estimateGasAsync.bind(self, _approved.toLowerCase(), _tokenId),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -128,7 +139,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isString('_approved', _approved);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_approved, _tokenId, txData);
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_approved.toLowerCase(), _tokenId, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -149,7 +160,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isString('_approved', _approved);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved, _tokenId]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_approved.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -158,6 +172,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -178,7 +196,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved, _tokenId]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_approved.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -187,6 +208,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
@@ -200,7 +225,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_approved,
|
||||
_approved.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -218,8 +243,8 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -229,8 +254,12 @@ export class ERC721TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferFrom.estimateGasAsync.bind(self, _from, _to, _tokenId),
|
||||
self.transferFrom.estimateGasAsync.bind(self, _from.toLowerCase(), _to.toLowerCase(), _tokenId),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -246,7 +275,12 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(_from, _to, _tokenId, txData);
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -270,8 +304,8 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -282,6 +316,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -305,8 +343,8 @@ export class ERC721TokenContract extends BaseContract {
|
||||
}
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -317,6 +355,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
@@ -331,8 +373,8 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -350,8 +392,8 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -361,8 +403,12 @@ export class ERC721TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.safeTransferFrom1.estimateGasAsync.bind(self, _from, _to, _tokenId),
|
||||
self.safeTransferFrom1.estimateGasAsync.bind(self, _from.toLowerCase(), _to.toLowerCase(), _tokenId),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -378,7 +424,12 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const txHashPromise = self.safeTransferFrom1.sendTransactionAsync(_from, _to, _tokenId, txData);
|
||||
const txHashPromise = self.safeTransferFrom1.sendTransactionAsync(
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -402,8 +453,8 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -414,6 +465,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -437,8 +492,8 @@ export class ERC721TokenContract extends BaseContract {
|
||||
}
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -449,6 +504,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('safeTransferFrom(address,address,uint256)');
|
||||
@@ -463,8 +522,8 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -495,6 +554,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('ownerOf(uint256)');
|
||||
@@ -526,7 +589,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner]);
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -535,6 +598,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
@@ -546,7 +613,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
getABIEncodedTransactionData(_owner: string): string {
|
||||
assert.isString('_owner', _owner);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner.toLowerCase()]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -559,7 +626,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isString('_operator', _operator);
|
||||
assert.isBoolean('_approved', _approved);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator, _approved]);
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [
|
||||
_operator.toLowerCase(),
|
||||
_approved,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -567,8 +637,12 @@ export class ERC721TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.setApprovalForAll.estimateGasAsync.bind(self, _operator, _approved),
|
||||
self.setApprovalForAll.estimateGasAsync.bind(self, _operator.toLowerCase(), _approved),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -582,7 +656,11 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isString('_operator', _operator);
|
||||
assert.isBoolean('_approved', _approved);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const txHashPromise = self.setApprovalForAll.sendTransactionAsync(_operator, _approved, txData);
|
||||
const txHashPromise = self.setApprovalForAll.sendTransactionAsync(
|
||||
_operator.toLowerCase(),
|
||||
_approved,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -603,7 +681,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isString('_operator', _operator);
|
||||
assert.isBoolean('_approved', _approved);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator, _approved]);
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [
|
||||
_operator.toLowerCase(),
|
||||
_approved,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -612,6 +693,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -632,7 +717,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator, _approved]);
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [
|
||||
_operator.toLowerCase(),
|
||||
_approved,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -641,6 +729,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('setApprovalForAll(address,bool)');
|
||||
@@ -654,7 +746,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isBoolean('_approved', _approved);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [
|
||||
_operator,
|
||||
_operator.toLowerCase(),
|
||||
_approved,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -674,8 +766,8 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isString('_data', _data);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
_data,
|
||||
]);
|
||||
@@ -686,8 +778,18 @@ export class ERC721TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.safeTransferFrom2.estimateGasAsync.bind(self, _from, _to, _tokenId, _data),
|
||||
self.safeTransferFrom2.estimateGasAsync.bind(
|
||||
self,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
_data,
|
||||
),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -705,7 +807,13 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
assert.isString('_data', _data);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const txHashPromise = self.safeTransferFrom2.sendTransactionAsync(_from, _to, _tokenId, _data, txData);
|
||||
const txHashPromise = self.safeTransferFrom2.sendTransactionAsync(
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
_data,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -731,8 +839,8 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isString('_data', _data);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
_data,
|
||||
]);
|
||||
@@ -744,6 +852,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -769,8 +881,8 @@ export class ERC721TokenContract extends BaseContract {
|
||||
}
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_tokenId,
|
||||
_data,
|
||||
]);
|
||||
@@ -782,6 +894,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('safeTransferFrom(address,address,uint256,bytes)');
|
||||
@@ -798,7 +914,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'safeTransferFrom(address,address,uint256,bytes)',
|
||||
[_from, _to, _tokenId, _data],
|
||||
[_from.toLowerCase(), _to.toLowerCase(), _tokenId, _data],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -821,7 +937,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('isApprovedForAll(address,address)', [_owner, _operator]);
|
||||
const encodedData = self._strictEncodeArguments('isApprovedForAll(address,address)', [
|
||||
_owner.toLowerCase(),
|
||||
_operator.toLowerCase(),
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -830,6 +949,10 @@ export class ERC721TokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('isApprovedForAll(address,address)');
|
||||
@@ -843,8 +966,8 @@ export class ERC721TokenContract extends BaseContract {
|
||||
assert.isString('_operator', _operator);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('isApprovedForAll(address,address)', [
|
||||
_owner,
|
||||
_operator,
|
||||
_owner.toLowerCase(),
|
||||
_operator.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
|
||||
@@ -52,6 +52,10 @@ export class EthBalanceCheckerContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getEthBalances(address[])');
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -74,7 +74,15 @@ export class ForwarderContract extends BaseContract {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)',
|
||||
[orders, makerAssetFillAmount, signatures, feeOrders, feeSignatures, feePercentage, feeRecipient],
|
||||
[
|
||||
orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient.toLowerCase(),
|
||||
],
|
||||
);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -91,9 +99,13 @@ export class ForwarderContract extends BaseContract {
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient,
|
||||
feeRecipient.toLowerCase(),
|
||||
),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -150,7 +162,7 @@ export class ForwarderContract extends BaseContract {
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient,
|
||||
feeRecipient.toLowerCase(),
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
@@ -211,7 +223,15 @@ export class ForwarderContract extends BaseContract {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)',
|
||||
[orders, makerAssetFillAmount, signatures, feeOrders, feeSignatures, feePercentage, feeRecipient],
|
||||
[
|
||||
orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient.toLowerCase(),
|
||||
],
|
||||
);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -221,6 +241,10 @@ export class ForwarderContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -294,7 +318,15 @@ export class ForwarderContract extends BaseContract {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)',
|
||||
[orders, makerAssetFillAmount, signatures, feeOrders, feeSignatures, feePercentage, feeRecipient],
|
||||
[
|
||||
orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient.toLowerCase(),
|
||||
],
|
||||
);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -304,6 +336,10 @@ export class ForwarderContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
@@ -374,7 +410,15 @@ export class ForwarderContract extends BaseContract {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)',
|
||||
[orders, makerAssetFillAmount, signatures, feeOrders, feeSignatures, feePercentage, feeRecipient],
|
||||
[
|
||||
orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient.toLowerCase(),
|
||||
],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -398,6 +442,10 @@ export class ForwarderContract extends BaseContract {
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.withdrawAsset.estimateGasAsync.bind(self, assetData, amount),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -441,6 +489,10 @@ export class ForwarderContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -470,6 +522,10 @@ export class ForwarderContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('withdrawAsset(bytes,uint256)');
|
||||
@@ -509,6 +565,10 @@ export class ForwarderContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
@@ -568,7 +628,7 @@ export class ForwarderContract extends BaseContract {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)',
|
||||
[orders, signatures, feeOrders, feeSignatures, feePercentage, feeRecipient],
|
||||
[orders, signatures, feeOrders, feeSignatures, feePercentage, feeRecipient.toLowerCase()],
|
||||
);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -584,9 +644,13 @@ export class ForwarderContract extends BaseContract {
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient,
|
||||
feeRecipient.toLowerCase(),
|
||||
),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -640,7 +704,7 @@ export class ForwarderContract extends BaseContract {
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient,
|
||||
feeRecipient.toLowerCase(),
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
@@ -699,7 +763,7 @@ export class ForwarderContract extends BaseContract {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)',
|
||||
[orders, signatures, feeOrders, feeSignatures, feePercentage, feeRecipient],
|
||||
[orders, signatures, feeOrders, feeSignatures, feePercentage, feeRecipient.toLowerCase()],
|
||||
);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -709,6 +773,10 @@ export class ForwarderContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -780,7 +848,7 @@ export class ForwarderContract extends BaseContract {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)',
|
||||
[orders, signatures, feeOrders, feeSignatures, feePercentage, feeRecipient],
|
||||
[orders, signatures, feeOrders, feeSignatures, feePercentage, feeRecipient.toLowerCase()],
|
||||
);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -790,6 +858,10 @@ export class ForwarderContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
@@ -858,7 +930,7 @@ export class ForwarderContract extends BaseContract {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)',
|
||||
[orders, signatures, feeOrders, feeSignatures, feePercentage, feeRecipient],
|
||||
[orders, signatures, feeOrders, feeSignatures, feePercentage, feeRecipient.toLowerCase()],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -867,7 +939,7 @@ export class ForwarderContract extends BaseContract {
|
||||
async sendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -875,8 +947,12 @@ export class ForwarderContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferOwnership.estimateGasAsync.bind(self, newOwner),
|
||||
self.transferOwnership.estimateGasAsync.bind(self, newOwner.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -888,7 +964,7 @@ export class ForwarderContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner, txData);
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -904,7 +980,7 @@ export class ForwarderContract extends BaseContract {
|
||||
async estimateGasAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -913,6 +989,10 @@ export class ForwarderContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -927,7 +1007,7 @@ export class ForwarderContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -936,6 +1016,10 @@ export class ForwarderContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
@@ -947,7 +1031,9 @@ export class ForwarderContract extends BaseContract {
|
||||
getABIEncodedTransactionData(newOwner: string): string {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [
|
||||
newOwner.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -1031,7 +1117,6 @@ export class ForwarderContract extends BaseContract {
|
||||
{
|
||||
name: 'orders',
|
||||
type: 'tuple[]',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAddress',
|
||||
@@ -1094,7 +1179,6 @@ export class ForwarderContract extends BaseContract {
|
||||
{
|
||||
name: 'feeOrders',
|
||||
type: 'tuple[]',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAddress',
|
||||
@@ -1164,7 +1248,6 @@ export class ForwarderContract extends BaseContract {
|
||||
{
|
||||
name: 'orderFillResults',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAssetFilledAmount',
|
||||
@@ -1187,7 +1270,6 @@ export class ForwarderContract extends BaseContract {
|
||||
{
|
||||
name: 'feeOrderFillResults',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAssetFilledAmount',
|
||||
@@ -1250,7 +1332,6 @@ export class ForwarderContract extends BaseContract {
|
||||
{
|
||||
name: 'orders',
|
||||
type: 'tuple[]',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAddress',
|
||||
@@ -1309,7 +1390,6 @@ export class ForwarderContract extends BaseContract {
|
||||
{
|
||||
name: 'feeOrders',
|
||||
type: 'tuple[]',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAddress',
|
||||
@@ -1379,7 +1459,6 @@ export class ForwarderContract extends BaseContract {
|
||||
{
|
||||
name: 'orderFillResults',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAssetFilledAmount',
|
||||
@@ -1402,7 +1481,6 @@ export class ForwarderContract extends BaseContract {
|
||||
{
|
||||
name: 'feeOrderFillResults',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAssetFilledAmount',
|
||||
|
||||
@@ -31,7 +31,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -39,8 +39,12 @@ export class IAssetProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.addAuthorizedAddress.estimateGasAsync.bind(self, target),
|
||||
self.addAuthorizedAddress.estimateGasAsync.bind(self, target.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -52,7 +56,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -68,7 +72,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -77,6 +81,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -91,7 +99,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -100,6 +108,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
|
||||
@@ -111,7 +123,9 @@ export class IAssetProxyContract extends BaseContract {
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [
|
||||
target.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -119,7 +133,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -127,8 +141,12 @@ export class IAssetProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.removeAuthorizedAddress.estimateGasAsync.bind(self, target),
|
||||
self.removeAuthorizedAddress.estimateGasAsync.bind(self, target.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -140,7 +158,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -156,7 +174,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -165,6 +183,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -179,7 +201,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -188,6 +210,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
|
||||
@@ -199,7 +225,9 @@ export class IAssetProxyContract extends BaseContract {
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [
|
||||
target.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -213,7 +241,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
assert.isBigNumber('index', index);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
target.toLowerCase(),
|
||||
index,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -223,8 +251,12 @@ export class IAssetProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.removeAuthorizedAddressAtIndex.estimateGasAsync.bind(self, target, index),
|
||||
self.removeAuthorizedAddressAtIndex.estimateGasAsync.bind(self, target.toLowerCase(), index),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -238,7 +270,11 @@ export class IAssetProxyContract extends BaseContract {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(target, index, txData);
|
||||
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(
|
||||
target.toLowerCase(),
|
||||
index,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -260,7 +296,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
assert.isBigNumber('index', index);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
target.toLowerCase(),
|
||||
index,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -271,6 +307,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -292,7 +332,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
}
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
target.toLowerCase(),
|
||||
index,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -303,6 +343,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
|
||||
@@ -317,7 +361,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'removeAuthorizedAddressAtIndex(address,uint256)',
|
||||
[target, index],
|
||||
[target.toLowerCase(), index],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -337,8 +381,8 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(bytes,address,address,uint256)', [
|
||||
assetData,
|
||||
from,
|
||||
to,
|
||||
from.toLowerCase(),
|
||||
to.toLowerCase(),
|
||||
amount,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -348,8 +392,12 @@ export class IAssetProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferFrom.estimateGasAsync.bind(self, assetData, from, to, amount),
|
||||
self.transferFrom.estimateGasAsync.bind(self, assetData, from.toLowerCase(), to.toLowerCase(), amount),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -367,7 +415,13 @@ export class IAssetProxyContract extends BaseContract {
|
||||
assert.isString('to', to);
|
||||
assert.isBigNumber('amount', amount);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(assetData, from, to, amount, txData);
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(
|
||||
assetData,
|
||||
from.toLowerCase(),
|
||||
to.toLowerCase(),
|
||||
amount,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -394,8 +448,8 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(bytes,address,address,uint256)', [
|
||||
assetData,
|
||||
from,
|
||||
to,
|
||||
from.toLowerCase(),
|
||||
to.toLowerCase(),
|
||||
amount,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -406,6 +460,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -432,8 +490,8 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(bytes,address,address,uint256)', [
|
||||
assetData,
|
||||
from,
|
||||
to,
|
||||
from.toLowerCase(),
|
||||
to.toLowerCase(),
|
||||
amount,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -444,6 +502,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(bytes,address,address,uint256)');
|
||||
@@ -460,7 +522,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'transferFrom(bytes,address,address,uint256)',
|
||||
[assetData, from, to, amount],
|
||||
[assetData, from.toLowerCase(), to.toLowerCase(), amount],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -485,6 +547,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
||||
@@ -519,6 +585,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
|
||||
@@ -537,7 +607,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
async sendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -545,8 +615,12 @@ export class IAssetProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferOwnership.estimateGasAsync.bind(self, newOwner),
|
||||
self.transferOwnership.estimateGasAsync.bind(self, newOwner.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -558,7 +632,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner, txData);
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -574,7 +648,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
async estimateGasAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -583,6 +657,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -597,7 +675,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -606,6 +684,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
@@ -617,7 +699,9 @@ export class IAssetProxyContract extends BaseContract {
|
||||
getABIEncodedTransactionData(newOwner: string): string {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [
|
||||
newOwner.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -49,7 +49,7 @@ export class IValidatorContract extends BaseContract {
|
||||
const self = (this as any) as IValidatorContract;
|
||||
const encodedData = self._strictEncodeArguments('isValidSignature(bytes32,address,bytes)', [
|
||||
hash,
|
||||
signerAddress,
|
||||
signerAddress.toLowerCase(),
|
||||
signature,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -60,6 +60,10 @@ export class IValidatorContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,address,bytes)');
|
||||
@@ -75,7 +79,7 @@ export class IValidatorContract extends BaseContract {
|
||||
const self = (this as any) as IValidatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('isValidSignature(bytes32,address,bytes)', [
|
||||
hash,
|
||||
signerAddress,
|
||||
signerAddress.toLowerCase(),
|
||||
signature,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
|
||||
@@ -54,6 +54,10 @@ export class IWalletContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,bytes)');
|
||||
|
||||
@@ -74,6 +74,10 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('assetProxies(bytes4)');
|
||||
@@ -93,7 +97,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -101,8 +105,12 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.addAuthorizedAddress.estimateGasAsync.bind(self, target),
|
||||
self.addAuthorizedAddress.estimateGasAsync.bind(self, target.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -114,7 +122,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -130,7 +138,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -139,6 +147,10 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -153,7 +165,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -162,6 +174,10 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
|
||||
@@ -173,7 +189,9 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [
|
||||
target.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -202,6 +220,10 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('authorities(uint256)');
|
||||
@@ -242,6 +264,10 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getAssetProxy(bytes4)');
|
||||
@@ -261,7 +287,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -269,8 +295,12 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.removeAuthorizedAddress.estimateGasAsync.bind(self, target),
|
||||
self.removeAuthorizedAddress.estimateGasAsync.bind(self, target.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -282,7 +312,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -298,7 +328,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -307,6 +337,10 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -321,7 +355,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -330,6 +364,10 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
|
||||
@@ -341,7 +379,9 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [
|
||||
target.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -365,6 +405,10 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
@@ -389,7 +433,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
assert.isBigNumber('index', index);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
target.toLowerCase(),
|
||||
index,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -399,8 +443,12 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.removeAuthorizedAddressAtIndex.estimateGasAsync.bind(self, target, index),
|
||||
self.removeAuthorizedAddressAtIndex.estimateGasAsync.bind(self, target.toLowerCase(), index),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -414,7 +462,11 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(target, index, txData);
|
||||
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(
|
||||
target.toLowerCase(),
|
||||
index,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -436,7 +488,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
assert.isBigNumber('index', index);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
target.toLowerCase(),
|
||||
index,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -447,6 +499,10 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -468,7 +524,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
}
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
target.toLowerCase(),
|
||||
index,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -479,6 +535,10 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
|
||||
@@ -493,7 +553,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'removeAuthorizedAddressAtIndex(address,uint256)',
|
||||
[target, index],
|
||||
[target.toLowerCase(), index],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -518,6 +578,10 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
||||
@@ -548,7 +612,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('authorized(address)', [index_0]);
|
||||
const encodedData = self._strictEncodeArguments('authorized(address)', [index_0.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -557,6 +621,10 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('authorized(address)');
|
||||
@@ -568,7 +636,9 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
getABIEncodedTransactionData(index_0: string): string {
|
||||
assert.isString('index_0', index_0);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('authorized(address)', [index_0]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('authorized(address)', [
|
||||
index_0.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -576,7 +646,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
async sendTransactionAsync(assetProxy: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('assetProxy', assetProxy);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy]);
|
||||
const encodedData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -584,8 +654,12 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.registerAssetProxy.estimateGasAsync.bind(self, assetProxy),
|
||||
self.registerAssetProxy.estimateGasAsync.bind(self, assetProxy.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -597,7 +671,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('assetProxy', assetProxy);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const txHashPromise = self.registerAssetProxy.sendTransactionAsync(assetProxy, txData);
|
||||
const txHashPromise = self.registerAssetProxy.sendTransactionAsync(assetProxy.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -613,7 +687,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
async estimateGasAsync(assetProxy: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('assetProxy', assetProxy);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy]);
|
||||
const encodedData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -622,6 +696,10 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -640,7 +718,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy]);
|
||||
const encodedData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -649,6 +727,10 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('registerAssetProxy(address)');
|
||||
@@ -660,7 +742,9 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
getABIEncodedTransactionData(assetProxy: string): string {
|
||||
assert.isString('assetProxy', assetProxy);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('registerAssetProxy(address)', [
|
||||
assetProxy.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -684,6 +768,10 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
|
||||
@@ -702,7 +790,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
async sendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -710,8 +798,12 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferOwnership.estimateGasAsync.bind(self, newOwner),
|
||||
self.transferOwnership.estimateGasAsync.bind(self, newOwner.toLowerCase()),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -723,7 +815,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner, txData);
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner.toLowerCase(), txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -739,7 +831,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
async estimateGasAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -748,6 +840,10 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -762,7 +858,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -771,6 +867,10 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
@@ -782,7 +882,9 @@ export class MultiAssetProxyContract extends BaseContract {
|
||||
getABIEncodedTransactionData(newOwner: string): string {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as MultiAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [
|
||||
newOwner.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -73,7 +73,7 @@ export class OrderValidatorContract extends BaseContract {
|
||||
const self = (this as any) as OrderValidatorContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'getOrderAndTraderInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),address)',
|
||||
[order, takerAddress],
|
||||
[order, takerAddress.toLowerCase()],
|
||||
);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -83,6 +83,10 @@ export class OrderValidatorContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
@@ -128,7 +132,7 @@ export class OrderValidatorContract extends BaseContract {
|
||||
const self = (this as any) as OrderValidatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'getOrderAndTraderInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),address)',
|
||||
[order, takerAddress],
|
||||
[order, takerAddress.toLowerCase()],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -152,7 +156,7 @@ export class OrderValidatorContract extends BaseContract {
|
||||
}
|
||||
const self = (this as any) as OrderValidatorContract;
|
||||
const encodedData = self._strictEncodeArguments('getBalanceAndAllowance(address,bytes)', [
|
||||
target,
|
||||
target.toLowerCase(),
|
||||
assetData,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -163,6 +167,10 @@ export class OrderValidatorContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getBalanceAndAllowance(address,bytes)');
|
||||
@@ -176,7 +184,7 @@ export class OrderValidatorContract extends BaseContract {
|
||||
assert.isString('assetData', assetData);
|
||||
const self = (this as any) as OrderValidatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getBalanceAndAllowance(address,bytes)', [
|
||||
target,
|
||||
target.toLowerCase(),
|
||||
assetData,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -239,6 +247,10 @@ export class OrderValidatorContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
@@ -344,6 +356,10 @@ export class OrderValidatorContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
@@ -410,7 +426,10 @@ export class OrderValidatorContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as OrderValidatorContract;
|
||||
const encodedData = self._strictEncodeArguments('getERC721TokenOwner(address,uint256)', [token, tokenId]);
|
||||
const encodedData = self._strictEncodeArguments('getERC721TokenOwner(address,uint256)', [
|
||||
token.toLowerCase(),
|
||||
tokenId,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -419,6 +438,10 @@ export class OrderValidatorContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getERC721TokenOwner(address,uint256)');
|
||||
@@ -432,7 +455,7 @@ export class OrderValidatorContract extends BaseContract {
|
||||
assert.isBigNumber('tokenId', tokenId);
|
||||
const self = (this as any) as OrderValidatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getERC721TokenOwner(address,uint256)', [
|
||||
token,
|
||||
token.toLowerCase(),
|
||||
tokenId,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -457,7 +480,7 @@ export class OrderValidatorContract extends BaseContract {
|
||||
}
|
||||
const self = (this as any) as OrderValidatorContract;
|
||||
const encodedData = self._strictEncodeArguments('getBalancesAndAllowances(address,bytes[])', [
|
||||
target,
|
||||
target.toLowerCase(),
|
||||
assetData,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -468,6 +491,10 @@ export class OrderValidatorContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getBalancesAndAllowances(address,bytes[])');
|
||||
@@ -481,7 +508,7 @@ export class OrderValidatorContract extends BaseContract {
|
||||
assert.isArray('assetData', assetData);
|
||||
const self = (this as any) as OrderValidatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getBalancesAndAllowances(address,bytes[])', [
|
||||
target,
|
||||
target.toLowerCase(),
|
||||
assetData,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -528,7 +555,7 @@ export class OrderValidatorContract extends BaseContract {
|
||||
const self = (this as any) as OrderValidatorContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'getTraderInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),address)',
|
||||
[order, takerAddress],
|
||||
[order, takerAddress.toLowerCase()],
|
||||
);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -538,6 +565,10 @@ export class OrderValidatorContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
@@ -578,7 +609,7 @@ export class OrderValidatorContract extends BaseContract {
|
||||
const self = (this as any) as OrderValidatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'getTraderInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),address)',
|
||||
[order, takerAddress],
|
||||
[order, takerAddress.toLowerCase()],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -653,7 +684,6 @@ export class OrderValidatorContract extends BaseContract {
|
||||
{
|
||||
name: 'order',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAddress',
|
||||
@@ -715,7 +745,6 @@ export class OrderValidatorContract extends BaseContract {
|
||||
{
|
||||
name: 'orderInfo',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'orderStatus',
|
||||
@@ -734,7 +763,6 @@ export class OrderValidatorContract extends BaseContract {
|
||||
{
|
||||
name: 'traderInfo',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerBalance',
|
||||
@@ -808,7 +836,6 @@ export class OrderValidatorContract extends BaseContract {
|
||||
{
|
||||
name: 'orders',
|
||||
type: 'tuple[]',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAddress',
|
||||
@@ -870,7 +897,6 @@ export class OrderValidatorContract extends BaseContract {
|
||||
{
|
||||
name: 'ordersInfo',
|
||||
type: 'tuple[]',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'orderStatus',
|
||||
@@ -889,7 +915,6 @@ export class OrderValidatorContract extends BaseContract {
|
||||
{
|
||||
name: 'tradersInfo',
|
||||
type: 'tuple[]',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerBalance',
|
||||
@@ -936,7 +961,6 @@ export class OrderValidatorContract extends BaseContract {
|
||||
{
|
||||
name: 'orders',
|
||||
type: 'tuple[]',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAddress',
|
||||
@@ -998,7 +1022,6 @@ export class OrderValidatorContract extends BaseContract {
|
||||
{
|
||||
name: '',
|
||||
type: 'tuple[]',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerBalance',
|
||||
@@ -1095,7 +1118,6 @@ export class OrderValidatorContract extends BaseContract {
|
||||
{
|
||||
name: 'order',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerAddress',
|
||||
@@ -1157,7 +1179,6 @@ export class OrderValidatorContract extends BaseContract {
|
||||
{
|
||||
name: 'traderInfo',
|
||||
type: 'tuple',
|
||||
|
||||
components: [
|
||||
{
|
||||
name: 'makerBalance',
|
||||
|
||||
@@ -82,6 +82,10 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('name()');
|
||||
@@ -101,7 +105,7 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isString('guy', guy);
|
||||
assert.isBigNumber('wad', wad);
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [guy, wad]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [guy.toLowerCase(), wad]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -109,8 +113,12 @@ export class WETH9Contract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.approve.estimateGasAsync.bind(self, guy, wad),
|
||||
self.approve.estimateGasAsync.bind(self, guy.toLowerCase(), wad),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -124,7 +132,7 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isString('guy', guy);
|
||||
assert.isBigNumber('wad', wad);
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const txHashPromise = self.approve.sendTransactionAsync(guy, wad, txData);
|
||||
const txHashPromise = self.approve.sendTransactionAsync(guy.toLowerCase(), wad, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -141,7 +149,7 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isString('guy', guy);
|
||||
assert.isBigNumber('wad', wad);
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [guy, wad]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [guy.toLowerCase(), wad]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -150,6 +158,10 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -170,7 +182,7 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [guy, wad]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [guy.toLowerCase(), wad]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -179,6 +191,10 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
@@ -191,7 +207,10 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isString('guy', guy);
|
||||
assert.isBigNumber('wad', wad);
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [guy, wad]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
guy.toLowerCase(),
|
||||
wad,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -215,6 +234,10 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
|
||||
@@ -240,7 +263,11 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isString('dst', dst);
|
||||
assert.isBigNumber('wad', wad);
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [src, dst, wad]);
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
src.toLowerCase(),
|
||||
dst.toLowerCase(),
|
||||
wad,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -248,8 +275,12 @@ export class WETH9Contract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferFrom.estimateGasAsync.bind(self, src, dst, wad),
|
||||
self.transferFrom.estimateGasAsync.bind(self, src.toLowerCase(), dst.toLowerCase(), wad),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -265,7 +296,12 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isString('dst', dst);
|
||||
assert.isBigNumber('wad', wad);
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(src, dst, wad, txData);
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(
|
||||
src.toLowerCase(),
|
||||
dst.toLowerCase(),
|
||||
wad,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -288,7 +324,11 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isString('dst', dst);
|
||||
assert.isBigNumber('wad', wad);
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [src, dst, wad]);
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
src.toLowerCase(),
|
||||
dst.toLowerCase(),
|
||||
wad,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -297,6 +337,10 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -319,7 +363,11 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [src, dst, wad]);
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
src.toLowerCase(),
|
||||
dst.toLowerCase(),
|
||||
wad,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -328,6 +376,10 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
@@ -342,8 +394,8 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isBigNumber('wad', wad);
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
src,
|
||||
dst,
|
||||
src.toLowerCase(),
|
||||
dst.toLowerCase(),
|
||||
wad,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -363,6 +415,10 @@ export class WETH9Contract extends BaseContract {
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.withdraw.estimateGasAsync.bind(self, wad),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -399,6 +455,10 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -422,6 +482,10 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('withdraw(uint256)');
|
||||
@@ -457,6 +521,10 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('decimals()');
|
||||
@@ -487,7 +555,7 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [index_0]);
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [index_0.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -496,6 +564,10 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
@@ -507,7 +579,9 @@ export class WETH9Contract extends BaseContract {
|
||||
getABIEncodedTransactionData(index_0: string): string {
|
||||
assert.isString('index_0', index_0);
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [index_0]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [
|
||||
index_0.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -531,6 +605,10 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('symbol()');
|
||||
@@ -550,7 +628,7 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isString('dst', dst);
|
||||
assert.isBigNumber('wad', wad);
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [dst, wad]);
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [dst.toLowerCase(), wad]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -558,8 +636,12 @@ export class WETH9Contract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transfer.estimateGasAsync.bind(self, dst, wad),
|
||||
self.transfer.estimateGasAsync.bind(self, dst.toLowerCase(), wad),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -573,7 +655,7 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isString('dst', dst);
|
||||
assert.isBigNumber('wad', wad);
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const txHashPromise = self.transfer.sendTransactionAsync(dst, wad, txData);
|
||||
const txHashPromise = self.transfer.sendTransactionAsync(dst.toLowerCase(), wad, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -590,7 +672,7 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isString('dst', dst);
|
||||
assert.isBigNumber('wad', wad);
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [dst, wad]);
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [dst.toLowerCase(), wad]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -599,6 +681,10 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -619,7 +705,7 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [dst, wad]);
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [dst.toLowerCase(), wad]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -628,6 +714,10 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
|
||||
@@ -640,7 +730,10 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isString('dst', dst);
|
||||
assert.isBigNumber('wad', wad);
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [dst, wad]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [
|
||||
dst.toLowerCase(),
|
||||
wad,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -657,6 +750,10 @@ export class WETH9Contract extends BaseContract {
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.deposit.estimateGasAsync.bind(self),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -690,6 +787,10 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -712,6 +813,10 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('deposit()');
|
||||
@@ -744,7 +849,10 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const encodedData = self._strictEncodeArguments('allowance(address,address)', [index_0, index_1]);
|
||||
const encodedData = self._strictEncodeArguments('allowance(address,address)', [
|
||||
index_0.toLowerCase(),
|
||||
index_1.toLowerCase(),
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -753,6 +861,10 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
|
||||
@@ -766,8 +878,8 @@ export class WETH9Contract extends BaseContract {
|
||||
assert.isString('index_1', index_1);
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('allowance(address,address)', [
|
||||
index_0,
|
||||
index_1,
|
||||
index_0.toLowerCase(),
|
||||
index_1.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
|
||||
@@ -66,6 +66,10 @@ export class ZRXTokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('name()');
|
||||
@@ -89,7 +93,10 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_spender.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -97,8 +104,12 @@ export class ZRXTokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.approve.estimateGasAsync.bind(self, _spender, _value),
|
||||
self.approve.estimateGasAsync.bind(self, _spender.toLowerCase(), _value),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -112,7 +123,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_spender, _value, txData);
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_spender.toLowerCase(), _value, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -133,7 +144,10 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_spender.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -142,6 +156,10 @@ export class ZRXTokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -162,7 +180,10 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_spender.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -171,6 +192,10 @@ export class ZRXTokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
@@ -184,7 +209,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_spender,
|
||||
_spender.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -210,6 +235,10 @@ export class ZRXTokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
|
||||
@@ -236,8 +265,8 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -247,8 +276,12 @@ export class ZRXTokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferFrom.estimateGasAsync.bind(self, _from, _to, _value),
|
||||
self.transferFrom.estimateGasAsync.bind(self, _from.toLowerCase(), _to.toLowerCase(), _value),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -264,7 +297,12 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(_from, _to, _value, txData);
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -288,8 +326,8 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -300,6 +338,10 @@ export class ZRXTokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -323,8 +365,8 @@ export class ZRXTokenContract extends BaseContract {
|
||||
}
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -335,6 +377,10 @@ export class ZRXTokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
@@ -349,8 +395,8 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_from.toLowerCase(),
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -376,6 +422,10 @@ export class ZRXTokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('decimals()');
|
||||
@@ -406,7 +456,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner]);
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner.toLowerCase()]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -415,6 +465,10 @@ export class ZRXTokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
@@ -426,7 +480,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
getABIEncodedTransactionData(_owner: string): string {
|
||||
assert.isString('_owner', _owner);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner.toLowerCase()]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -450,6 +504,10 @@ export class ZRXTokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('symbol()');
|
||||
@@ -473,7 +531,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to.toLowerCase(), _value]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -481,8 +539,12 @@ export class ZRXTokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transfer.estimateGasAsync.bind(self, _to, _value),
|
||||
self.transfer.estimateGasAsync.bind(self, _to.toLowerCase(), _value),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
@@ -496,7 +558,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const txHashPromise = self.transfer.sendTransactionAsync(_to, _value, txData);
|
||||
const txHashPromise = self.transfer.sendTransactionAsync(_to.toLowerCase(), _value, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@@ -513,7 +575,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to.toLowerCase(), _value]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -522,6 +584,10 @@ export class ZRXTokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
if (txDataWithDefaults.from !== undefined) {
|
||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
||||
}
|
||||
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
@@ -542,7 +608,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to.toLowerCase(), _value]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -551,6 +617,10 @@ export class ZRXTokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
|
||||
@@ -563,7 +633,10 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [
|
||||
_to.toLowerCase(),
|
||||
_value,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@@ -585,7 +658,10 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('allowance(address,address)', [_owner, _spender]);
|
||||
const encodedData = self._strictEncodeArguments('allowance(address,address)', [
|
||||
_owner.toLowerCase(),
|
||||
_spender.toLowerCase(),
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -594,6 +670,10 @@ export class ZRXTokenContract extends BaseContract {
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
callDataWithDefaults.from = callDataWithDefaults.from
|
||||
? callDataWithDefaults.from.toLowerCase()
|
||||
: callDataWithDefaults.from;
|
||||
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
|
||||
@@ -607,8 +687,8 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isString('_spender', _spender);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('allowance(address,address)', [
|
||||
_owner,
|
||||
_spender,
|
||||
_owner.toLowerCase(),
|
||||
_spender.toLowerCase(),
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
|
||||
@@ -1,4 +1,47 @@
|
||||
[
|
||||
{
|
||||
"version": "3.1.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Python method parameters are now in snake case",
|
||||
"pr": 1919
|
||||
},
|
||||
{
|
||||
"note": "Python wrappers now support tuples in method parameters",
|
||||
"pr": 1919
|
||||
},
|
||||
{
|
||||
"note": "document Python method's bytes params as requiring UTF-8",
|
||||
"pr": 1919
|
||||
},
|
||||
{
|
||||
"note": "generate Python output into a contract-named folder, not a file (eg exchange/__init__.py rather than exchange.py) leaving space for user-defined additions to the same module, such as for custom types, as used by the Exchange wrapper's manually-written type aliases in the contract_wrappers.exchange.types Python module",
|
||||
"pr": 1919
|
||||
},
|
||||
{
|
||||
"note": "support for customizable parameter validation for Python wrappers",
|
||||
"pr": 1919
|
||||
},
|
||||
{
|
||||
"note": "wrap Python docstrings better, for pydocstyle compliance",
|
||||
"pr": 1919
|
||||
},
|
||||
{
|
||||
"note": "lots of fixes to satisfy linters of generated Python code",
|
||||
"pr": 1919
|
||||
}
|
||||
],
|
||||
"timestamp": 1563957393
|
||||
},
|
||||
{
|
||||
"timestamp": 1563047529,
|
||||
"version": "2.1.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.0",
|
||||
"changes": [
|
||||
|
||||
@@ -5,6 +5,20 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.1 - _July 24, 2019_
|
||||
|
||||
* Python method parameters are now in snake case (#1919)
|
||||
* Python wrappers now support tuples in method parameters (#1919)
|
||||
* document Python method's bytes params as requiring UTF-8 (#1919)
|
||||
* generate Python output into a contract-named folder, not a file (eg exchange/__init__.py rather than exchange.py) leaving space for user-defined additions to the same module, such as for custom types, as used by the Exchange wrapper's manually-written type aliases in the contract_wrappers.exchange.types Python module (#1919)
|
||||
* support for customizable parameter validation for Python wrappers (#1919)
|
||||
* wrap Python docstrings better, for pydocstyle compliance (#1919)
|
||||
* lots of fixes to satisfy linters of generated Python code (#1919)
|
||||
|
||||
## v2.1.1 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.0 - _July 13, 2019_
|
||||
|
||||
* Initial support for Python (#1878)
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
"evm.bytecode.object",
|
||||
"evm.bytecode.sourceMap",
|
||||
"evm.deployedBytecode.object",
|
||||
"evm.deployedBytecode.sourceMap"
|
||||
"evm.deployedBytecode.sourceMap",
|
||||
"devdoc"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/abi-gen",
|
||||
"version": "2.1.0",
|
||||
"version": "3.1.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -33,7 +33,7 @@
|
||||
"generate_contract_wrappers": "run-p gen_typescript gen_python",
|
||||
"gen_typescript": "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 ./test-cli/output/typescript --backend ethers",
|
||||
"gen_python": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/Python/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/Python/partials/**/*.handlebars' --output ./test-cli/output/python --language Python",
|
||||
"diff_contract_wrappers": "./diff.sh ./test-cli/expected-output ./test-cli/output",
|
||||
"diff_contract_wrappers": "test-cli/diff.sh ./test-cli/expected-output ./test-cli/output",
|
||||
"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",
|
||||
@@ -56,13 +56,13 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md",
|
||||
"dependencies": {
|
||||
"@0x/types": "^2.4.0",
|
||||
"@0x/typescript-typings": "^4.2.3",
|
||||
"@0x/utils": "^4.4.0",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"chalk": "^2.3.0",
|
||||
"change-case": "^3.0.2",
|
||||
"cli-format": "^3.0.9",
|
||||
"ethereum-types": "^2.1.3",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"glob": "^7.1.2",
|
||||
"handlebars": "^4.0.11",
|
||||
"lodash": "^4.17.11",
|
||||
@@ -72,14 +72,13 @@
|
||||
"yargs": "^10.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/base-contract": "^5.1.1",
|
||||
"@0x/contracts-gen": "^1.0.10",
|
||||
"@0x/dev-utils": "^2.2.4",
|
||||
"@0x/sol-compiler": "^3.1.9",
|
||||
"@0x/subproviders": "^4.1.1",
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/subproviders": "^4.1.2",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@0x/utils": "^4.3.3",
|
||||
"@0x/web3-wrapper": "^6.0.7",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"@types/glob": "5.0.35",
|
||||
"@types/handlebars": "^4.0.36",
|
||||
"@types/mkdirp": "^0.5.2",
|
||||
|
||||
@@ -4,7 +4,16 @@ import { AbiEncoder, abiUtils, logUtils } from '@0x/utils';
|
||||
import chalk from 'chalk';
|
||||
import * as changeCase from 'change-case';
|
||||
import * as cliFormat from 'cli-format';
|
||||
import { AbiDefinition, ConstructorAbi, ContractAbi, DevdocOutput, EventAbi, MethodAbi } from 'ethereum-types';
|
||||
import {
|
||||
AbiDefinition,
|
||||
ConstructorAbi,
|
||||
ContractAbi,
|
||||
DataItem,
|
||||
DevdocOutput,
|
||||
EventAbi,
|
||||
MethodAbi,
|
||||
TupleDataItem,
|
||||
} from 'ethereum-types';
|
||||
import { sync as globSync } from 'glob';
|
||||
import * as Handlebars from 'handlebars';
|
||||
import * as _ from 'lodash';
|
||||
@@ -84,6 +93,10 @@ function registerTypeScriptHelpers(): void {
|
||||
Handlebars.registerHelper('assertionType', utils.solTypeToAssertion.bind(utils));
|
||||
Handlebars.registerHelper('returnType', utils.solTypeToTsType.bind(utils, ParamKind.Output, args.backend));
|
||||
|
||||
Handlebars.registerHelper('ifEquals', function(this: typeof Handlebars, arg1: any, arg2: any, options: any): void {
|
||||
return arg1 === arg2 ? options.fn(this) : options.inverse(this); // tslint:disable-line:no-invalid-this
|
||||
});
|
||||
|
||||
// Check if 0 or false exists
|
||||
Handlebars.registerHelper(
|
||||
'isDefined',
|
||||
@@ -98,8 +111,9 @@ function registerPythonHelpers(): void {
|
||||
return lhs === rhs;
|
||||
});
|
||||
Handlebars.registerHelper('safeString', (str, options) => new Handlebars.SafeString(str));
|
||||
Handlebars.registerHelper('parameterType', utils.solTypeToPyType.bind(utils, ParamKind.Input, args.backend));
|
||||
Handlebars.registerHelper('returnType', utils.solTypeToPyType.bind(utils, ParamKind.Output, args.backend));
|
||||
Handlebars.registerHelper('parameterType', utils.solTypeToPyType.bind(utils));
|
||||
Handlebars.registerHelper('returnType', utils.solTypeToPyType.bind(utils));
|
||||
Handlebars.registerHelper('toPythonIdentifier', utils.toPythonIdentifier.bind(utils));
|
||||
Handlebars.registerHelper(
|
||||
'sanitizeDevdocDetails',
|
||||
(methodName: string, devdocDetails: string, indent: number, options) => {
|
||||
@@ -112,12 +126,111 @@ function registerPythonHelpers(): void {
|
||||
return new Handlebars.SafeString(
|
||||
`\n${cliFormat.wrap(devdocDetails || '', {
|
||||
paddingLeft: ' '.repeat(indent),
|
||||
width: columnsPerRow - indent,
|
||||
width: columnsPerRow,
|
||||
ansi: false,
|
||||
})}\n`,
|
||||
);
|
||||
},
|
||||
);
|
||||
Handlebars.registerHelper(
|
||||
'makeParameterDocstringRole',
|
||||
(name: string, description: string, indent: number, options) => {
|
||||
let docstring = `:param ${name}:`;
|
||||
if (description && description.length > 0) {
|
||||
docstring = `${docstring} ${description}`;
|
||||
}
|
||||
return new Handlebars.SafeString(utils.wrapPythonDocstringRole(docstring, indent));
|
||||
},
|
||||
);
|
||||
Handlebars.registerHelper(
|
||||
'makeReturnDocstringRole',
|
||||
(description: string, indent: number, options) =>
|
||||
new Handlebars.SafeString(utils.wrapPythonDocstringRole(`:returns: ${description}`, indent)),
|
||||
);
|
||||
Handlebars.registerHelper(
|
||||
'makeEventParameterDocstringRole',
|
||||
(eventName: string, indent: number, options) =>
|
||||
new Handlebars.SafeString(
|
||||
utils.wrapPythonDocstringRole(
|
||||
`:param tx_hash: hash of transaction emitting ${eventName} event`,
|
||||
indent,
|
||||
),
|
||||
),
|
||||
);
|
||||
Handlebars.registerHelper('tupleDefinitions', (abisJSON: string, options) => {
|
||||
const abis: AbiDefinition[] = JSON.parse(abisJSON);
|
||||
// build an array of objects, each of which has one key, the Python
|
||||
// name of a tuple, with a string value holding the Python
|
||||
// definition of that tuple. Using a key-value object conveniently
|
||||
// filters duplicate references to the same tuple.
|
||||
const tupleDefinitions: { [pythonTupleName: string]: string } = {};
|
||||
for (const abi of abis) {
|
||||
let parameters: DataItem[] = [];
|
||||
if (abi.hasOwnProperty('inputs')) {
|
||||
// HACK(feuGeneA): using "as MethodAbi" below, but abi
|
||||
// could just as well be ConstructorAbi, EventAbi, etc. We
|
||||
// just need to tell the TypeScript compiler that it's NOT
|
||||
// FallbackAbi, or else it would complain, "Property
|
||||
// 'inputs' does not exist on type 'AbiDefinition'.
|
||||
// Property 'inputs' does not exist on type
|
||||
// 'FallbackAbi'.", despite the enclosing if statement.
|
||||
// tslint:disable:no-unnecessary-type-assertion
|
||||
parameters = parameters.concat((abi as MethodAbi).inputs);
|
||||
}
|
||||
if (abi.hasOwnProperty('outputs')) {
|
||||
// HACK(feuGeneA): same as described above, except here we
|
||||
// KNOW that it's a MethodAbi, given the enclosing if
|
||||
// statement, because that's the only AbiDefinition subtype
|
||||
// that actually has an outputs field.
|
||||
parameters = parameters.concat((abi as MethodAbi).outputs);
|
||||
}
|
||||
for (const parameter of parameters) {
|
||||
if (parameter.type === 'tuple') {
|
||||
tupleDefinitions[
|
||||
utils.makePythonTupleName((parameter as TupleDataItem).components)
|
||||
] = utils.makePythonTupleClassBody((parameter as TupleDataItem).components);
|
||||
}
|
||||
}
|
||||
}
|
||||
const tupleDeclarations = [];
|
||||
for (const pythonTupleName in tupleDefinitions) {
|
||||
if (tupleDefinitions[pythonTupleName]) {
|
||||
tupleDeclarations.push(
|
||||
`class ${pythonTupleName}(TypedDict):\n """Python representation of a tuple or struct.\n\n A tuple found in an ABI may have been written in Solidity as a literal\n tuple, or it may have been written as a parameter with a Solidity\n \`struct\`:code: data type; there's no way to tell which, based solely on the\n ABI, and the name of a Solidity \`struct\`:code: is not conveyed through the\n ABI. This class represents a tuple that appeared in a method definition.\n Its name is derived from a hash of that tuple's field names, and every\n method whose ABI refers to a tuple with that same list of field names will\n have a generated wrapper method that refers to this class.\n\n Any members of type \`bytes\`:code: should be encoded as UTF-8, which can be\n accomplished via \`str.encode("utf_8")\`:code:\n """${
|
||||
tupleDefinitions[pythonTupleName]
|
||||
}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
return new Handlebars.SafeString(tupleDeclarations.join('\n\n'));
|
||||
});
|
||||
Handlebars.registerHelper('docBytesIfNecessary', (abisJSON: string, options) => {
|
||||
const abis: AbiDefinition[] = JSON.parse(abisJSON);
|
||||
// see if any ABIs accept params of type bytes, and if so then emit
|
||||
// explanatory documentation string.
|
||||
for (const abi of abis) {
|
||||
if (abi.hasOwnProperty('inputs')) {
|
||||
// HACK(feuGeneA): using "as MethodAbi" below, but abi
|
||||
// could just as well be ConstructorAbi, EventAbi, etc. We
|
||||
// just need to tell the TypeScript compiler that it's NOT
|
||||
// FallbackAbi, or else it would complain, "Property
|
||||
// 'inputs' does not exist on type 'AbiDefinition'.
|
||||
// Property 'inputs' does not exist on type
|
||||
// 'FallbackAbi'.", despite the enclosing if statement.
|
||||
// tslint:disable:no-unnecessary-type-assertion
|
||||
if ((abi as MethodAbi).inputs) {
|
||||
for (const input of (abi as MethodAbi).inputs) {
|
||||
if (input.type === 'bytes') {
|
||||
return new Handlebars.SafeString(
|
||||
'\n\n All method parameters of type `bytes`:code: should be encoded as UTF-8,\n which can be accomplished via `str.encode("utf_8")`:code:.\n ',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return '';
|
||||
});
|
||||
}
|
||||
if (args.language === 'TypeScript') {
|
||||
registerTypeScriptHelpers();
|
||||
@@ -164,16 +277,17 @@ for (const abiFileName of abiFileNames) {
|
||||
}
|
||||
|
||||
const outFileName = utils.makeOutputFileName(namedContent.name);
|
||||
const outFileExtension = (() => {
|
||||
const outFilePath = (() => {
|
||||
if (args.language === 'TypeScript') {
|
||||
return 'ts';
|
||||
return `${args.output}/${outFileName}.ts`;
|
||||
} else if (args.language === 'Python') {
|
||||
return 'py';
|
||||
const directory = `${args.output}/${outFileName}`;
|
||||
mkdirp.sync(directory);
|
||||
return `${directory}/__init__.py`;
|
||||
} else {
|
||||
throw new Error(`Unexpected language '${args.language}'`);
|
||||
}
|
||||
})();
|
||||
const outFilePath = `${args.output}/${outFileName}.${outFileExtension}`;
|
||||
|
||||
if (utils.isOutputFileUpToDate(outFilePath, [abiFileName, args.template, ...partialTemplateFileNames])) {
|
||||
logUtils.log(`Already up to date: ${chalk.bold(outFilePath)}`);
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import { createHash } from 'crypto';
|
||||
|
||||
import * as changeCase from 'change-case';
|
||||
import * as cliFormat from 'cli-format';
|
||||
import { AbiType, ConstructorAbi, DataItem } from 'ethereum-types';
|
||||
import * as fs from 'fs';
|
||||
import * as _ from 'lodash';
|
||||
@@ -98,12 +102,12 @@ export const utils = {
|
||||
throw new Error(`Unknown Solidity type found: ${solType}`);
|
||||
}
|
||||
},
|
||||
solTypeToPyType(paramKind: ParamKind, backend: ContractsBackend, solType: string, components?: DataItem[]): string {
|
||||
solTypeToPyType(solType: string, components?: DataItem[]): string {
|
||||
const trailingArrayRegex = /\[\d*\]$/;
|
||||
if (solType.match(trailingArrayRegex)) {
|
||||
const arrayItemSolType = solType.replace(trailingArrayRegex, '');
|
||||
const arrayItemPyType = utils.solTypeToPyType(paramKind, backend, arrayItemSolType, components);
|
||||
const arrayPyType = `Array[${arrayItemPyType}]`;
|
||||
const arrayItemPyType = utils.solTypeToPyType(arrayItemSolType, components);
|
||||
const arrayPyType = `List[${arrayItemPyType}]`;
|
||||
return arrayPyType;
|
||||
} else {
|
||||
const solTypeRegexToPyType = [
|
||||
@@ -121,18 +125,7 @@ export const utils = {
|
||||
}
|
||||
const TUPLE_TYPE_REGEX = '^tuple$';
|
||||
if (solType.match(TUPLE_TYPE_REGEX)) {
|
||||
const componentsType = _.map(components, component => {
|
||||
const componentValueType = utils.solTypeToPyType(
|
||||
paramKind,
|
||||
backend,
|
||||
component.type,
|
||||
component.components,
|
||||
);
|
||||
const componentType = `'${component.name}': ${componentValueType}`;
|
||||
return componentType;
|
||||
});
|
||||
const pyType = `TypedDict('${solType}(${components})', {${componentsType.join(',')}}`;
|
||||
return pyType;
|
||||
return utils.makePythonTupleName(components as DataItem[]);
|
||||
}
|
||||
throw new Error(`Unknown Solidity type found: ${solType}`);
|
||||
}
|
||||
@@ -190,4 +183,171 @@ export const utils = {
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* simply concatenate all of the names of the components, and convert that
|
||||
* concatenation into PascalCase to conform to Python convention.
|
||||
*/
|
||||
makePythonTupleName(tupleComponents: DataItem[]): string {
|
||||
const lengthOfHashSuffix = 8;
|
||||
return `Tuple0x${createHash('MD5')
|
||||
.update(_.map(tupleComponents, component => component.name).join('_'))
|
||||
.digest()
|
||||
.toString('hex')
|
||||
.substring(0, lengthOfHashSuffix)}`;
|
||||
},
|
||||
/**
|
||||
* @returns a string that is a Python code snippet that's intended to be
|
||||
* used as the second parameter to a TypedDict() instantiation; value
|
||||
* looks like "{ 'python_dict_key': python_type, ... }".
|
||||
*/
|
||||
makePythonTupleClassBody(tupleComponents: DataItem[]): string {
|
||||
let toReturn: string = '';
|
||||
for (const tupleComponent of tupleComponents) {
|
||||
toReturn = `${toReturn}\n\n ${tupleComponent.name}: ${utils.solTypeToPyType(
|
||||
tupleComponent.type,
|
||||
tupleComponent.components,
|
||||
)}`;
|
||||
}
|
||||
toReturn = `${toReturn}`;
|
||||
return toReturn;
|
||||
},
|
||||
/**
|
||||
* used to generate Python-parseable identifier names for parameters to
|
||||
* contract methods.
|
||||
*/
|
||||
toPythonIdentifier(input: string): string {
|
||||
let snakeCased = changeCase.snake(input);
|
||||
const pythonReservedWords = [
|
||||
'False',
|
||||
'None',
|
||||
'True',
|
||||
'and',
|
||||
'as',
|
||||
'assert',
|
||||
'break',
|
||||
'class',
|
||||
'continue',
|
||||
'def',
|
||||
'del',
|
||||
'elif',
|
||||
'else',
|
||||
'except',
|
||||
'finally',
|
||||
'for',
|
||||
'from',
|
||||
'global',
|
||||
'if',
|
||||
'import',
|
||||
'in',
|
||||
'is',
|
||||
'lambda',
|
||||
'nonlocal',
|
||||
'not',
|
||||
'or',
|
||||
'pass',
|
||||
'raise',
|
||||
'return',
|
||||
'try',
|
||||
'while',
|
||||
'with',
|
||||
'yield',
|
||||
];
|
||||
const pythonBuiltins = [
|
||||
'abs',
|
||||
'delattr',
|
||||
'hash',
|
||||
'memoryview',
|
||||
'set',
|
||||
'all',
|
||||
'dict',
|
||||
'help',
|
||||
'min',
|
||||
'setattr',
|
||||
'any',
|
||||
'dir',
|
||||
'hex',
|
||||
'next',
|
||||
'slice',
|
||||
'ascii',
|
||||
'divmod',
|
||||
'id',
|
||||
'object',
|
||||
'sorted',
|
||||
'bin',
|
||||
'enumerate',
|
||||
'input',
|
||||
'oct',
|
||||
'staticmethod',
|
||||
'bool',
|
||||
'eval',
|
||||
'int',
|
||||
'open',
|
||||
'str',
|
||||
'breakpoint',
|
||||
'exec',
|
||||
'isinstance',
|
||||
'ord',
|
||||
'sum',
|
||||
'bytearray',
|
||||
'filter',
|
||||
'issubclass',
|
||||
'pow',
|
||||
'super',
|
||||
'bytes',
|
||||
'float',
|
||||
'iter',
|
||||
'print',
|
||||
'tuple',
|
||||
'callable',
|
||||
'format',
|
||||
'len',
|
||||
'property',
|
||||
'type',
|
||||
'chr',
|
||||
'frozenset',
|
||||
'list',
|
||||
'range',
|
||||
'vars',
|
||||
'classmethod',
|
||||
'getattr',
|
||||
'locals',
|
||||
'repr',
|
||||
'zip',
|
||||
'compile',
|
||||
'globals',
|
||||
'map',
|
||||
'reversed',
|
||||
'__import__',
|
||||
'complex',
|
||||
'hasattr',
|
||||
'max',
|
||||
'round',
|
||||
];
|
||||
if (
|
||||
pythonReservedWords.includes(snakeCased) ||
|
||||
pythonBuiltins.includes(snakeCased) ||
|
||||
/*changeCase strips leading underscores :(*/ input[0] === '_'
|
||||
) {
|
||||
snakeCased = `_${snakeCased}`;
|
||||
}
|
||||
return snakeCased;
|
||||
},
|
||||
/**
|
||||
* Python docstrings are used to generate documentation, and that
|
||||
* transformation supports annotation of parameters, return types, etc, via
|
||||
* re-Structured Text "interpreted text roles". Per the pydocstyle linter,
|
||||
* such annotations should be line-wrapped at 80 columns, with a hanging
|
||||
* indent of 4 columns. This function simply returns an accordingly
|
||||
* wrapped and hanging-indented `role` string.
|
||||
*/
|
||||
wrapPythonDocstringRole(docstring: string, indent: number): string {
|
||||
const columnsPerIndent = 4;
|
||||
const columnsPerRow = 80;
|
||||
return cliFormat.wrap(docstring, {
|
||||
paddingLeft: ' '.repeat(indent),
|
||||
width: columnsPerRow,
|
||||
ansi: false,
|
||||
hangingIndent: ' '.repeat(columnsPerIndent),
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user