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

Arbitrary Fee Tokens #1819

Merged
merged 77 commits into from
May 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
4d9ef5d
Add fee assetData fields to OrderWithoutDomain and Order types
abandeali1 Apr 5, 2019
145590d
Add fee assetData fields to order JSON schema
abandeali1 Apr 5, 2019
1071205
Update order utils to use new order schema
abandeali1 Apr 5, 2019
8e5dd5a
temp
abandeali1 Apr 10, 2019
409ed7f
In `@0x/order-utils`: Fix order hash tests.
dorothy-zbornak May 8, 2019
9db8a21
`@0x/contracts-exchange`: Remove `zrxAssetData` from constructor and …
dorothy-zbornak May 9, 2019
d957f35
`@0x/contracts-exchange-libs`: Add `takerFeeAssetData` and `makerFeeA…
dorothy-zbornak May 9, 2019
b5aa375
Remove `contract-wrappers` `contracts-exchange-forwarder` and `contra…
dorothy-zbornak May 13, 2019
e52ec50
Update `order-utils` for ZEIP-28
dorothy-zbornak May 13, 2019
8206a46
Update `fill-scenarios` for ZEIP-28
dorothy-zbornak May 13, 2019
0e2bf9d
`json-schemas`: Update changelog.
dorothy-zbornak May 13, 2019
56daf09
`@0x/contracts-test-utils`: Update types for arbitrary fee tokens.
dorothy-zbornak May 14, 2019
06bdc39
`@0x/contracts-exchange`: Update fill order tests for arbitrary fee t…
dorothy-zbornak May 14, 2019
46450b8
`@0x/contracts-coordinator`: Remove ZRX token from coordinator tests.
dorothy-zbornak May 14, 2019
b7f56ee
`@0x/contracts-exchange`: Fix `Fill` emit code.
dorothy-zbornak May 14, 2019
57e6357
`@0x/exchange-libs`: Remove `LibAbiEncoder`
dorothy-zbornak May 15, 2019
3fc4ecc
`@0x/contracts-exchange-forwarder`: Remove dependency on `LibAbiEncod…
dorothy-zbornak May 15, 2019
650e859
`@0x/contracts-exchange`: Remove dependency on `LibAbiEncoder`.
dorothy-zbornak May 15, 2019
bae7806
`@0x/typescript-typings`: Add more overloads for `ethereumjs-util` `s…
dorothy-zbornak May 15, 2019
765f91a
`@0x/contracts-test-utils`: Increase deployment numbers for dummy tok…
dorothy-zbornak May 15, 2019
67c92c1
`@0x/order-utils`: Move order expiration check to top in order valida…
dorothy-zbornak May 15, 2019
9e2aa10
`@0x/contracts-exchange`: Fix combinatorial `fillOrder` test bugs.
dorothy-zbornak May 15, 2019
8dbe296
`@0x/contracts-exchange`: Enable all tests.
dorothy-zbornak May 15, 2019
a1887ef
`@0x/contracts-exchange`: Fix `matchOrders` and signature tests.
dorothy-zbornak May 15, 2019
a39558f
`@0x/contracts-test-utils`: Remove `TransferAmountsByMatchOrders` and…
dorothy-zbornak May 16, 2019
c026830
`@0x/contracts-exchange`: Fix `matchOrders()` not paying fees if same…
dorothy-zbornak May 16, 2019
ba5f7d8
`@0x/contracts-exchange`: Rewrote `MatchOrderTester` class to be simp…
dorothy-zbornak May 16, 2019
8970c4c
`@0x/contracts-exchange`: Allow custom `ExchangeWrapper.matchOrders()…
dorothy-zbornak May 16, 2019
ad6afd1
`@0x/contracts-exchange`: Fix broken match orders tests
dorothy-zbornak May 16, 2019
8297b79
`@0x/contracts-exchange`: Enable all exchange tests.
dorothy-zbornak May 16, 2019
de7ae7b
Ran prettier and fixed linter errors
dorothy-zbornak May 16, 2019
661dae7
Update CI config to blacklist `contracts-extensions` and `contracts-e…
dorothy-zbornak May 16, 2019
879a4e7
Update changelogs
dorothy-zbornak May 16, 2019
ef59ef0
`@0x/contracts-echange`: Fix transactions test bug with `ExchangeWrap…
dorothy-zbornak May 16, 2019
f372d6c
`@0x/contracts-exchange`: Fix Exchange Wrappers tests.
dorothy-zbornak May 17, 2019
a101087
`@0x/contracts-exchange-libs`: Add `generate-exchange-selectors` pack…
dorothy-zbornak May 17, 2019
29c644d
`@0x/contracts-coordinator`: Fix broken coordinator tests.
dorothy-zbornak May 17, 2019
ee40bf9
Ran prettier
dorothy-zbornak May 17, 2019
3d169d1
Update changelogs with PR #s
dorothy-zbornak May 17, 2019
458c32c
`@0x/contracts-exchange-libs`: Make `generate-exchange-selectors` ter…
dorothy-zbornak May 17, 2019
ab6f8b7
`@0x/assert`: Add `isNumberLike` assertion
dorothy-zbornak May 18, 2019
f86c9f9
`@0x/web3-wrapper`: Let `toBaseUnitAmount()` accept a `number` as wel…
dorothy-zbornak May 18, 2019
52ce590
`@0x/utils`: Tweak `RevertError` to produce a meaningful `Error` mess…
dorothy-zbornak May 18, 2019
c14acf3
`@0x/order-utils`: Update `RevertError` types for new `RevertError` c…
dorothy-zbornak May 18, 2019
5a0b673
`@0x/dev-utils`: Move `Error` -> `RevertError` coercion logic to `@0x…
dorothy-zbornak May 18, 2019
17d2e69
`@0x/base-contract`: Add a method for converting `Error` types to `Re…
dorothy-zbornak May 18, 2019
47bbfcb
`@0x/contracts-asset-proxy`: Make `setProxyAllowanceForAll()` just ac…
dorothy-zbornak May 18, 2019
98a070b
`@0x/contracts-test-utils`: Add more `OrderScenario` related types.
dorothy-zbornak May 18, 2019
d7597a2
`@0x/contracts-exchange`: Major rework of `fill_order_combinatorial_u…
dorothy-zbornak May 18, 2019
6e7b067
`@0x/base-contract`: Re-wrap `StringRevertError`s as plain `Error`s f…
dorothy-zbornak May 18, 2019
5554dc1
`@0x/contracts-exchange`: Revert internal tests.
dorothy-zbornak May 18, 2019
132b871
`@0x/contracts-asset-proxy`: Fix broken `proxies` test.
dorothy-zbornak May 18, 2019
d5f2003
`@0x/contracts-exchange`: Removed dependency on OrderValidationUtils.…
dorothy-zbornak May 19, 2019
52ec0e1
`@0x/contracts-exchange-libs`: Convert `generate-exchange-selectors` …
dorothy-zbornak May 21, 2019
89d462d
`@0x/contracts-exchange`: Use function/event selectors from `LibExcha…
dorothy-zbornak May 21, 2019
0ef892c
`@0x/abi-gen-templates`: Automatically catch and decode ganache rever…
dorothy-zbornak May 22, 2019
cc16d86
`@0x/contracts-exchange-libs`: Regenerate `LibExchangeSelectors.sol`
dorothy-zbornak May 22, 2019
41c718c
`@0x/contracts-exchange-libs`: Make `EIP712_ORDER_SCHEMA_HASH` public.
dorothy-zbornak May 22, 2019
9aa797a
`@0x/contracts-exchange`: Fix indentation in `matchOrders()`.
dorothy-zbornak May 22, 2019
21b6dd9
`@0x/contracts-exchange`: Correct coding convention in `match_orders.ts`
dorothy-zbornak May 22, 2019
f7e2abb
Disable staking package from CI.
dorothy-zbornak May 22, 2019
199121d
`@0x/order-utils`: Add `ERC1155` to ExchangeTransferSimulator and fix…
dorothy-zbornak May 23, 2019
96dba9a
`@0x/contracts-asset-proxy`: Add `setProxyAllowanceForAllAsync()` to …
dorothy-zbornak May 23, 2019
7dfd33f
`@0x/contracts-erc1155`: Add `mintKnownFungibleTokensAsync()`, `isNon…
dorothy-zbornak May 23, 2019
7eac371
`@0x/contracts-exchange`: Add `MultiAssetProxy`, `ERC1155Fungible`, a…
dorothy-zbornak May 23, 2019
2c916fa
`@0x/contracts-exchange`: Re-eanble all exchange tests.
dorothy-zbornak May 23, 2019
f62f692
`@0x/contracts-test-utils`: Reduce number of test token deployments t…
dorothy-zbornak May 24, 2019
f50b27c
`@0x/contracts-exchange`: Fully incorporate ERC1155 and MultiAsset te…
dorothy-zbornak May 24, 2019
1357fa4
`@0x/contracts-exchange`: Fix build error.
dorothy-zbornak May 24, 2019
8f251bb
`@0x/contracs-test-utils`: Increase number of deployed ERC721 and ERC…
dorothy-zbornak May 24, 2019
564f3f0
`@0x/contracts-exchange`: Avoid redundant trasfer in `fillOrder()` wh…
dorothy-zbornak May 24, 2019
9577b00
`@0x/contracts-exchange`: Avoid redundant transfer in `matchOrders()`…
dorothy-zbornak May 24, 2019
84faad3
`@0x/contracts-exchange`: Update changelog.
dorothy-zbornak May 24, 2019
0d5635e
`@0x/contracts-exchange`: Remove `TODO` comment in `fill_order_combin…
dorothy-zbornak May 25, 2019
eb92b99
Update contracts/exchange/contracts/src/MixinMatchOrders.sol
dorothy-zbornak May 29, 2019
4f03b55
`@0x/contracts-exchange`: Fix critical error in `fillOrder()` and `ma…
dorothy-zbornak May 30, 2019
f4bcb67
`@0x/contracts-exchange`: Update settlement test simulators to match …
dorothy-zbornak May 30, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 35 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,29 @@ jobs:
- run: yarn wsrun test:circleci @0x/contracts-exchange-forwarder
- run: yarn wsrun test:circleci @0x/contracts-coordinator
- run: yarn wsrun test:circleci @0x/contracts-staking
test-contracts-ganache-3.0:
docker:
- image: circleci/node:9-browsers
working_directory: ~/repo
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn wsrun test:circleci @0x/contracts-multisig
- run: yarn wsrun test:circleci @0x/contracts-utils
- run: yarn wsrun test:circleci @0x/contracts-exchange-libs
- run: yarn wsrun test:circleci @0x/contracts-erc20
- run: yarn wsrun test:circleci @0x/contracts-erc721
- run: yarn wsrun test:circleci @0x/contracts-erc1155
# TODO(dorothy-zbornak): Re-enable after updating this package for 3.0.
# - run: yarn wsrun test:circleci @0x/contracts-extensions
- run: yarn wsrun test:circleci @0x/contracts-asset-proxy
- run: yarn wsrun test:circleci @0x/contracts-exchange
# TODO(dorothy-zbornak): Re-enable after updating this package for 3.0.
# - run: yarn wsrun test:circleci @0x/contracts-exchange-forwarder
dorothy-zbornak marked this conversation as resolved.
Show resolved Hide resolved
- run: yarn wsrun test:circleci @0x/contracts-coordinator
# TODO(dorothy-zbornak): Re-enable after this package is complete.
# - run: yarn wsrun test:circleci @0x/contracts-staking
test-contracts-geth:
docker:
- image: circleci/node:9-browsers
Expand Down Expand Up @@ -241,7 +264,8 @@ jobs:
- run: yarn wsrun test:circleci @0x/abi-gen
- run: yarn wsrun test:circleci @0x/assert
- run: yarn wsrun test:circleci @0x/base-contract
- run: yarn wsrun test:circleci @0x/contract-wrappers
# TODO(dorothy-zbornak): Re-enable after updating this package for 3.0.
# - 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/order-utils
Expand All @@ -262,10 +286,11 @@ jobs:
key: coverage-base-contract-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/base-contract/coverage/lcov.info
- save_cache:
key: coverage-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/contract-wrappers/coverage/lcov.info
# TODO(dorothy-zbornak): Re-enable after updating this package for 3.0.
# - save_cache:
# key: coverage-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
# paths:
# - ~/repo/packages/contract-wrappers/coverage/lcov.info
- save_cache:
key: coverage-dev-utils-{{ .Environment.CIRCLE_SHA1 }}
paths:
Expand Down Expand Up @@ -512,9 +537,10 @@ jobs:
- restore_cache:
keys:
- coverage-connect-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
# TODO(dorothy-zbornak): Re-enable after updating this package for 3.0.
# - restore_cache:
# keys:
# - coverage-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-dev-utils-{{ .Environment.CIRCLE_SHA1 }}
Expand Down Expand Up @@ -549,7 +575,7 @@ workflows:
# - build-website:
# requires:
# - build
- test-contracts-ganache:
- test-contracts-ganache-3.0:
requires:
- build-3.0
# Disabled until geth docker image is fixed.
Expand Down
12 changes: 12 additions & 0 deletions contracts/asset-proxy/CHANGELOG.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
{
"note": "Update tests to use contract-built-in `awaitTransactionSuccessAsync`",
"pr": 1797
},
{
"note": "Make `ERC721Wrapper.setApprovalForAll()` take an owner address instead of a token ID",
"pr": 1819
},
{
"note": "Automatically set unlimited proxy allowances in `ERC721.setBalancesAndAllowancesAsync()`",
"pr": 1819
},
{
"note": "Add `setProxyAllowanceForAllAsync()` to `ERC1155ProxyWrapper`.",
"pr": 1819
}
]
},
Expand Down
9 changes: 8 additions & 1 deletion contracts/asset-proxy/test/proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,14 @@ describe('Asset Transfer Proxies', () => {
// Verify pre-condition
const ownerFromAsset = await erc721TokenA.ownerOf.callAsync(erc721AFromTokenId);
expect(ownerFromAsset).to.be.equal(fromAddress);
// Remove transfer approval for fromAddress.
// Remove blanket transfer approval for fromAddress.
await erc721TokenA.setApprovalForAll.awaitTransactionSuccessAsync(
erc721Proxy.address,
false,
{ from: fromAddress },
constants.AWAIT_TRANSACTION_MINED_MS,
);
// Remove token transfer approval for fromAddress.
await erc721TokenA.approve.awaitTransactionSuccessAsync(
constants.NULL_ADDRESS,
erc721AFromTokenId,
Expand Down
16 changes: 16 additions & 0 deletions contracts/asset-proxy/test/utils/erc1155_proxy_wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,22 @@ export class ERC1155ProxyWrapper {
};
return holdingsByOwner;
}
/**
* @dev Set the approval for the proxy on behalf of `userAddress` .
* @param userAddress owner of ERC1155 tokens.
* @param contractAddress address of ERC1155 contract.
* @param isApproved Whether to approve the proxy for all or not.
*/
public async setProxyAllowanceForAllAsync(
userAddress: string,
contractAddress: string,
isApproved: boolean,
): Promise<void> {
this._validateProxyContractExistsOrThrow();
const tokenWrapper = this.getContractWrapper(contractAddress);
const operator = (this._proxyContract as ERC1155ProxyContract).address;
await tokenWrapper.setApprovalForAllAsync(userAddress, operator, isApproved);
}
/**
* @dev Checks if proxy is approved to transfer tokens on behalf of `userAddress`.
* @param userAddress owner of ERC1155 tokens.
Expand Down
11 changes: 7 additions & 4 deletions contracts/asset-proxy/test/utils/erc721_wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class ERC721Wrapper {
}
this._initialTokenIdsByOwner[tokenOwnerAddress][dummyTokenContract.address].push(tokenId);

await this.approveProxyAsync(dummyTokenContract.address, tokenId);
await this.approveProxyForAllAsync(dummyTokenContract.address, tokenOwnerAddress, true);
}
}
}
Expand All @@ -84,14 +84,17 @@ export class ERC721Wrapper {
const proxyAddress = (this._proxyContract as ERC721ProxyContract).address;
await this.approveAsync(proxyAddress, tokenAddress, tokenId);
}
public async approveProxyForAllAsync(tokenAddress: string, tokenId: BigNumber, isApproved: boolean): Promise<void> {
public async approveProxyForAllAsync(
tokenAddress: string,
ownerAddress: string,
isApproved: boolean,
): Promise<void> {
const tokenContract = this._getTokenContractFromAssetData(tokenAddress);
const tokenOwner = await this.ownerOfAsync(tokenAddress, tokenId);
const proxyAddress = (this._proxyContract as ERC721ProxyContract).address;
await tokenContract.setApprovalForAll.awaitTransactionSuccessAsync(
proxyAddress,
isApproved,
{ from: tokenOwner },
{ from: ownerAddress },
constants.AWAIT_TRANSACTION_MINED_MS,
);
}
Expand Down
4 changes: 4 additions & 0 deletions contracts/coordinator/CHANGELOG.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
{
"note": "Remove LibZeroExTransaction contract",
"pr": 1753
},
{
"note": "Update tests for arbitrary fee tokens (ZEIP-28).",
"pr": 1819
}
],
"timestamp": 1554997931
Expand Down
7 changes: 4 additions & 3 deletions contracts/coordinator/test/coordinator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('Coordinator tests', () => {
let erc20Proxy: ERC20ProxyContract;
let erc20TokenA: DummyERC20TokenContract;
let erc20TokenB: DummyERC20TokenContract;
let zrxToken: DummyERC20TokenContract;
let makerFeeToken: DummyERC20TokenContract;
let coordinatorContract: CoordinatorContract;
let exchange: ExchangeContract;

Expand All @@ -69,7 +69,7 @@ describe('Coordinator tests', () => {
erc20Wrapper = new ERC20Wrapper(provider, usedAddresses, owner);
erc20Proxy = await erc20Wrapper.deployProxyAsync();
const numDummyErc20ToDeploy = 3;
[erc20TokenA, erc20TokenB, zrxToken] = await erc20Wrapper.deployDummyTokensAsync(
[erc20TokenA, erc20TokenB, makerFeeToken] = await erc20Wrapper.deployDummyTokensAsync(
numDummyErc20ToDeploy,
constants.DUMMY_TOKEN_DECIMALS,
);
Expand All @@ -79,7 +79,6 @@ describe('Coordinator tests', () => {
exchangeArtifacts.Exchange,
provider,
txDefaults,
assetDataUtils.encodeERC20AssetData(zrxToken.address),
new BigNumber(chainId),
);

Expand Down Expand Up @@ -109,6 +108,8 @@ describe('Coordinator tests', () => {
feeRecipientAddress,
makerAssetData: assetDataUtils.encodeERC20AssetData(erc20TokenA.address),
takerAssetData: assetDataUtils.encodeERC20AssetData(erc20TokenB.address),
makerFeeAssetData: assetDataUtils.encodeERC20AssetData(makerFeeToken.address),
takerFeeAssetData: assetDataUtils.encodeERC20AssetData(makerFeeToken.address),
domain: {
verifyingContractAddress: exchange.address,
chainId,
Expand Down
2 changes: 2 additions & 0 deletions contracts/coordinator/test/mixins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ describe('Mixins tests', () => {
takerAssetAmount: constants.ZERO_AMOUNT,
makerFee: constants.ZERO_AMOUNT,
takerFee: constants.ZERO_AMOUNT,
makerFeeAssetData: constants.NULL_BYTES,
takerFeeAssetData: constants.NULL_BYTES,
fabioberger marked this conversation as resolved.
Show resolved Hide resolved
expirationTimeSeconds: constants.ZERO_AMOUNT,
salt: constants.ZERO_AMOUNT,
signature: constants.NULL_BYTES,
Expand Down
9 changes: 9 additions & 0 deletions contracts/erc1155/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[
{
"version": "1.1.2",
"changes": [
{
"note": "Add `mintKnownFungibleTokensAsync()`, `isNonFungibleItemAsync()`, `isFungibleItemAsync()`, `getOwnerOfAsync()`, `getBalanceAsync()` to `Erc1155Wrapper`.",
"pr": 1819
}
]
},
{
"version": "1.1.1",
"changes": [
Expand Down
43 changes: 33 additions & 10 deletions contracts/erc1155/test/utils/erc1155_wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,28 @@ export class Erc1155Wrapper {
);
// tslint:disable-next-line no-unnecessary-type-assertion
const createFungibleTokenLog = tx.logs[0] as LogWithDecodedArgs<ERC1155TransferSingleEventArgs>;
const token = createFungibleTokenLog.args.id;
const tokenId = createFungibleTokenLog.args.id;
await this.mintKnownFungibleTokensAsync(tokenId, beneficiaries, tokenAmounts);
return tokenId;
}
public async mintKnownFungibleTokensAsync(
tokenId: BigNumber,
beneficiaries: string[],
tokenAmounts: BigNumber | BigNumber[],
): Promise<void> {
const tokenAmountsAsArray = _.isArray(tokenAmounts) ? tokenAmounts : [];
if (!_.isArray(tokenAmounts)) {
_.each(_.range(0, beneficiaries.length), () => {
tokenAmountsAsArray.push(tokenAmounts);
});
}
await this._web3Wrapper.awaitTransactionSuccessAsync(
await this._erc1155Contract.mintFungible.sendTransactionAsync(token, beneficiaries, tokenAmountsAsArray, {
from: this._contractOwner,
}),
await this._erc1155Contract.mintFungible.awaitTransactionSuccessAsync(
tokenId,
beneficiaries,
tokenAmountsAsArray,
{ from: this._contractOwner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
return token;
}
public async mintNonFungibleTokensAsync(beneficiaries: string[]): Promise<[BigNumber, BigNumber[]]> {
const tokenUri = 'dummyNonFungibleToken';
Expand All @@ -106,10 +114,10 @@ export class Erc1155Wrapper {
// tslint:disable-next-line no-unnecessary-type-assertion
const createFungibleTokenLog = tx.logs[0] as LogWithDecodedArgs<ERC1155TransferSingleEventArgs>;
const token = createFungibleTokenLog.args.id;
await this._web3Wrapper.awaitTransactionSuccessAsync(
await this._erc1155Contract.mintNonFungible.sendTransactionAsync(token, beneficiaries, {
from: this._contractOwner,
}),
await this._erc1155Contract.mintNonFungible.awaitTransactionSuccessAsync(
token,
beneficiaries,
{ from: this._contractOwner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
const encodedNftIds: BigNumber[] = [];
Expand Down Expand Up @@ -156,4 +164,19 @@ export class Erc1155Wrapper {
expect(balance, `${ownersExtended[i]}${tokensExtended[i]}`).to.be.bignumber.equal(expectedBalances[i]);
});
}
public async isNonFungibleItemAsync(tokenId: BigNumber): Promise<boolean> {
return this._erc1155Contract.isNonFungibleItem.callAsync(tokenId);
}
public async isFungibleItemAsync(tokenId: BigNumber): Promise<boolean> {
return !(await this.isNonFungibleItemAsync(tokenId));
}
public async getOwnerOfAsync(tokenId: BigNumber): Promise<string> {
return this._erc1155Contract.ownerOf.callAsync(tokenId);
}
/**
* @dev Get the balance of an ERC1155 token for a given owner and token ID.
*/
public async getBalanceAsync(ownerAddress: string, tokenId: BigNumber): Promise<BigNumber> {
return this._erc1155Contract.balanceOf.callAsync(ownerAddress, tokenId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ contract MixinExchangeWrapper is
{
// ABI encode calldata for `fillOrder`
bytes memory fillOrderCalldata = abi.encodeWithSelector(
FILL_ORDER_SELECTOR,
// bytes4(keccak256("fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,bytes,bytes),uint256,bytes)"))
// = 0x9b44d556
0x9b44d556,
dorothy-zbornak marked this conversation as resolved.
Show resolved Hide resolved
order,
takerAssetFillAmount,
signature
Expand Down
12 changes: 12 additions & 0 deletions contracts/exchange-libs/CHANGELOG.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@
{
"note": "Reorder some revert error parameters for consistency",
"pr": 1790
},
{
"note": "Add new `Order` fields for arbitrary fee tokens (ZEIP-28).",
"pr": 1819
},
{
"note": "Remove `LibAbiEncoder` and `LibConstants`.",
"pr": 1819
},
{
"note": "Add `generate-exchange-selectors` package script.",
"pr": 1819
}
]
},
Expand Down
1 change: 0 additions & 1 deletion contracts/exchange-libs/compiler.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
}
},
"contracts": [
"src/LibConstants.sol",
"src/LibEIP712ExchangeDomain.sol",
"src/LibFillResults.sol",
"src/LibMath.sol",
Expand Down
48 changes: 0 additions & 48 deletions contracts/exchange-libs/contracts/src/LibConstants.sol

This file was deleted.

Loading