aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,