| |
| |
| |
| |
| @@ -2086,6 +2086,42 @@ describe('LimitOrderProtocol', function () { |
| .to.be.revertedWithCustomError(swap, 'InvalidMsgValue'); |
| }); |
| |
| + it('should be reverted if takerAsset does not contain code', async function () { |
| + const { tokens: { dai }, contracts: { swap }, chainId } = await loadFixture(deployContractsAndInit); |
| + |
| + await dai.mint(addr, '1000000'); |
| + |
| + const order = buildOrder({ |
| + makerAsset: await dai.getAddress(), |
| + takerAsset: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', |
| + makingAmount: 900, |
| + takingAmount: 900, |
| + maker: addr1.address, |
| + }); |
| + |
| + const { r, yParityAndS: vs } = ethers.Signature.from(await signOrder(order, chainId, await swap.getAddress(), addr1)); |
| + await expect(swap.fillOrder(order, r, vs, 900, fillWithMakingAmount(900))) |
| + .to.be.revertedWithCustomError(swap, 'TransferFromTakerToMakerFailed'); |
| + }); |
| + |
| + it('should be reverted if makerAsset does not contain code', async function () { |
| + const { tokens: { usdc }, contracts: { swap }, chainId } = await loadFixture(deployContractsAndInit); |
| + |
| + await usdc.approve(swap, '1000000'); |
| + |
| + const order = buildOrder({ |
| + makerAsset: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', |
| + takerAsset: await usdc.getAddress(), |
| + makingAmount: 900, |
| + takingAmount: 900, |
| + maker: addr1.address, |
| + }); |
| + |
| + const { r, yParityAndS: vs } = ethers.Signature.from(await signOrder(order, chainId, await swap.getAddress(), addr1)); |
| + await expect(swap.fillOrder(order, r, vs, 900, fillWithMakingAmount(900))) |
| + .to.be.revertedWithCustomError(swap, 'TransferFromMakerToTakerFailed'); |
| + }); |
| + |
| it('should revert with takerAsset WETH, unwrap flag is set and taker unable to receive excessive ETH', async function () { |
| const { tokens: { dai, weth }, contracts: { swap }, chainId } = await loadFixture(deployContractsAndInit); |
| |
| |
| new file mode 100644 |
| |
| |
| @@ -0,0 +1,4 @@ |
| +H4sIAAAAAAAAA+3R0QqCMBTG8V33FHsCc9b0JYJ6g1AnaKiLuaLHz3ZjBNVNEtH/d7EzzgbnwBcV |
| +p6Y1+6o/L8Vc4lGmdaijxxruSidxkqpspce+UmmcCKln2+jOafC5k1I4a/2rf+/ef1Q05e+rwe9L |
| +23V5b6Kh/tyMt/lnU/5JyH+dqjH/+HMrPPfn+ZdGhuCLyiz640XWuTN17uWtF47lpukav3Wmcjtn |
| +vS1tGx2Gxbf3BgAAAAAAAAAAAAAAACDEFRa4phsAKAAA |
| |
| new file mode 100755 |
| |
| |
| @@ -0,0 +1,6 @@ |
| +#!/usr/bin/env bash |
| + |
| +set -uo pipefail |
| +cd /testbed || exit 1 |
| +base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 |
| +exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' |
|
|