diff options
Diffstat (limited to 'packages/contracts')
-rw-r--r-- | packages/contracts/CHANGELOG.json | 10 | ||||
-rw-r--r-- | packages/contracts/contracts/extensions/OrderValidator/OrderValidator.sol | 2 | ||||
-rw-r--r-- | packages/contracts/package.json | 24 | ||||
-rw-r--r-- | packages/contracts/test/extensions/order_validator.ts | 13 |
4 files changed, 31 insertions, 18 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/package.json b/packages/contracts/package.json index c87e2e95b..25445c4f8 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "contracts", - "version": "2.1.54", + "version": "2.1.55", "engines": { "node": ">=6.12" }, @@ -22,7 +22,7 @@ "run_mocha": "mocha --require source-map-support/register --require make-promises-safe 'lib/test/**/*.js' --timeout 100000 --bail --exit", "compile": "sol-compiler --contracts-dir contracts", "clean": "shx rm -rf lib generated-artifacts generated-wrappers", - "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers", + "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers", "lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts", "coverage:report:text": "istanbul report text", "coverage:report:html": "istanbul report html && open coverage/index.html", @@ -45,11 +45,11 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/contracts/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.16", - "@0x/dev-utils": "^1.0.17", - "@0x/sol-compiler": "^1.1.12", - "@0x/sol-cov": "^2.1.12", - "@0x/subproviders": "^2.1.4", + "@0x/abi-gen": "^1.0.17", + "@0x/dev-utils": "^1.0.18", + "@0x/sol-compiler": "^1.1.13", + "@0x/sol-cov": "^2.1.13", + "@0x/subproviders": "^2.1.5", "@0x/tslint-config": "^1.0.10", "@types/bn.js": "^4.11.0", "@types/ethereumjs-abi": "^0.6.0", @@ -71,12 +71,12 @@ "yargs": "^10.0.3" }, "dependencies": { - "@0x/base-contract": "^3.0.6", - "@0x/order-utils": "^3.0.2", - "@0x/types": "^1.2.1", + "@0x/base-contract": "^3.0.7", + "@0x/order-utils": "^3.0.3", + "@0x/types": "^1.3.0", "@0x/typescript-typings": "^3.0.4", - "@0x/utils": "^2.0.5", - "@0x/web3-wrapper": "^3.1.4", + "@0x/utils": "^2.0.6", + "@0x/web3-wrapper": "^3.1.5", "@types/js-combinatorics": "^0.5.29", "bn.js": "^4.11.8", "ethereum-types": "^1.1.2", 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, |