aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-28 02:24:12 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-28 02:24:12 +0800
commit4ebc561986d2d46c8b888dfffe2728b47db34959 (patch)
tree2b1059c274338f58b23994044a2aec2d3d76eafe /packages/contracts
parente08fb72cf10f5260966e4dfd84873c326ff4ea61 (diff)
parentd23fd23e912ef2ca646048e2df70e2c016ce9986 (diff)
downloaddexon-0x-contracts-4ebc561986d2d46c8b888dfffe2728b47db34959.tar
dexon-0x-contracts-4ebc561986d2d46c8b888dfffe2728b47db34959.tar.gz
dexon-0x-contracts-4ebc561986d2d46c8b888dfffe2728b47db34959.tar.bz2
dexon-0x-contracts-4ebc561986d2d46c8b888dfffe2728b47db34959.tar.lz
dexon-0x-contracts-4ebc561986d2d46c8b888dfffe2728b47db34959.tar.xz
dexon-0x-contracts-4ebc561986d2d46c8b888dfffe2728b47db34959.tar.zst
dexon-0x-contracts-4ebc561986d2d46c8b888dfffe2728b47db34959.zip
Merge branch 'development' into feature/instant/stable-css-classes
Diffstat (limited to 'packages/contracts')
-rw-r--r--packages/contracts/CHANGELOG.json10
-rw-r--r--packages/contracts/contracts/extensions/OrderValidator/OrderValidator.sol2
-rw-r--r--packages/contracts/test/extensions/order_validator.ts13
3 files changed, 19 insertions, 6 deletions
diff --git a/packages/contracts/CHANGELOG.json b/packages/contracts/CHANGELOG.json
index 3f57a33d6..00f94c83b 100644
--- a/packages/contracts/CHANGELOG.json
+++ b/packages/contracts/CHANGELOG.json
@@ -1,5 +1,15 @@
[
{
+ "name": "OrderValidator",
+ "version": "1.0.1",
+ "changes": [
+ {
+ "note": "remove `getApproved` check from ERC721 approval query",
+ "pr": 1149
+ }
+ ]
+ },
+ {
"name": "Forwarder",
"version": "1.1.0",
"changes": [
diff --git a/packages/contracts/contracts/extensions/OrderValidator/OrderValidator.sol b/packages/contracts/contracts/extensions/OrderValidator/OrderValidator.sol
index 8bfde3847..3385d35ef 100644
--- a/packages/contracts/contracts/extensions/OrderValidator/OrderValidator.sol
+++ b/packages/contracts/contracts/extensions/OrderValidator/OrderValidator.sol
@@ -148,7 +148,7 @@ contract OrderValidator {
balance = target == owner ? 1 : 0;
// Check if ERC721Proxy is approved to spend tokenId
- bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;
+ bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy);
// Set alowance to 1 if ERC721Proxy is approved to spend tokenId
allowance = isApproved ? 1 : 0;
diff --git a/packages/contracts/test/extensions/order_validator.ts b/packages/contracts/test/extensions/order_validator.ts
index 37bd1b0e2..37d7c4c5a 100644
--- a/packages/contracts/test/extensions/order_validator.ts
+++ b/packages/contracts/test/extensions/order_validator.ts
@@ -198,7 +198,7 @@ describe('OrderValidator', () => {
);
expect(newAllowance).to.be.bignumber.equal(ERC721_ALLOWANCE);
});
- it('should return an allowance of 1 when ERC721Proxy is approved for specific tokenId', async () => {
+ it('should return an allowance of 0 when ERC721Proxy is approved for specific tokenId', async () => {
await web3Wrapper.awaitTransactionSuccessAsync(
await erc721Token.mint.sendTransactionAsync(makerAddress, tokenId),
constants.AWAIT_TRANSACTION_MINED_MS,
@@ -213,7 +213,7 @@ describe('OrderValidator', () => {
makerAddress,
erc721AssetData,
);
- expect(newAllowance).to.be.bignumber.equal(ERC721_ALLOWANCE);
+ expect(newAllowance).to.be.bignumber.equal(constants.ZERO_AMOUNT);
});
});
});
@@ -248,8 +248,9 @@ describe('OrderValidator', () => {
await erc721Token.mint.sendTransactionAsync(makerAddress, tokenId),
constants.AWAIT_TRANSACTION_MINED_MS,
);
+ const isApproved = true;
await web3Wrapper.awaitTransactionSuccessAsync(
- await erc721Token.approve.sendTransactionAsync(erc721Proxy.address, tokenId, {
+ await erc721Token.setApprovalForAll.sendTransactionAsync(erc721Proxy.address, isApproved, {
from: makerAddress,
}),
constants.AWAIT_TRANSACTION_MINED_MS,
@@ -311,8 +312,9 @@ describe('OrderValidator', () => {
await erc721Token.mint.sendTransactionAsync(takerAddress, tokenId),
constants.AWAIT_TRANSACTION_MINED_MS,
);
+ const isApproved = true;
await web3Wrapper.awaitTransactionSuccessAsync(
- await erc721Token.approve.sendTransactionAsync(erc721Proxy.address, tokenId, {
+ await erc721Token.setApprovalForAll.sendTransactionAsync(erc721Proxy.address, isApproved, {
from: takerAddress,
}),
constants.AWAIT_TRANSACTION_MINED_MS,
@@ -465,8 +467,9 @@ describe('OrderValidator', () => {
await erc721Token.mint.sendTransactionAsync(takerAddress, tokenId),
constants.AWAIT_TRANSACTION_MINED_MS,
);
+ const isApproved = true;
await web3Wrapper.awaitTransactionSuccessAsync(
- await erc721Token.approve.sendTransactionAsync(erc721Proxy.address, tokenId, {
+ await erc721Token.setApprovalForAll.sendTransactionAsync(erc721Proxy.address, isApproved, {
from: takerAddress,
}),
constants.AWAIT_TRANSACTION_MINED_MS,