diff --git a/contracts/Swaplace.sol b/contracts/Swaplace.sol index 5a672ee..5333911 100644 --- a/contracts/Swaplace.sol +++ b/contracts/Swaplace.sol @@ -46,7 +46,7 @@ contract Swaplace is SwapFactory, ISwaplace, IERC165 { _swaps[swapId] = swap; - emit SwapCreated(swapId, msg.sender, swap.expiry); + emit SwapCreated(swapId, msg.sender, swap.allowed, swap.expiry); return swapId; } diff --git a/contracts/interfaces/ISwaplace.sol b/contracts/interfaces/ISwaplace.sol index 0ff9378..af45e53 100644 --- a/contracts/interfaces/ISwaplace.sol +++ b/contracts/interfaces/ISwaplace.sol @@ -13,7 +13,8 @@ interface ISwaplace { event SwapCreated( uint256 indexed swapId, address indexed owner, - uint256 indexed expiry + address indexed allowed, + uint256 expiry ); /** @@ -80,4 +81,4 @@ interface ISwaplace { * If the `owner` is the zero address, then the Swap doesn't exist. */ function getSwap(uint256 swapId) external view returns (ISwap.Swap memory); -} +} \ No newline at end of file diff --git a/docs/interfaces/ISwaplace.md b/docs/interfaces/ISwaplace.md index 5e1481a..b3e08cc 100644 --- a/docs/interfaces/ISwaplace.md +++ b/docs/interfaces/ISwaplace.md @@ -7,7 +7,7 @@ Interface of the {Swaplace} implementation. ### SwapCreated ```solidity -event SwapCreated(uint256 swapId, address owner, uint256 expiry) +event SwapCreated(uint256 swapId, address owner, address allowed, uint256 expiry) ``` Emitted when a new Swap is created. diff --git a/test/TestSwaplace.test.ts b/test/TestSwaplace.test.ts index dc4cb94..4fd455d 100644 --- a/test/TestSwaplace.test.ts +++ b/test/TestSwaplace.test.ts @@ -72,7 +72,7 @@ describe("Swaplace", async function () { await expect(await Swaplace.connect(owner).createSwap(swap)) .to.emit(Swaplace, "SwapCreated") - .withArgs(await Swaplace.totalSwaps(), owner.address, swap.expiry); + .withArgs(await Swaplace.totalSwaps(), owner.address, swap.allowed, swap.expiry); }); it("Should be able to create a 1-N swap with ERC20", async function () { @@ -98,7 +98,7 @@ describe("Swaplace", async function () { await expect(await Swaplace.connect(owner).createSwap(swap)) .to.emit(Swaplace, "SwapCreated") - .withArgs(await Swaplace.totalSwaps(), owner.address, swap.expiry); + .withArgs(await Swaplace.totalSwaps(), owner.address, swap.allowed, swap.expiry); }); it("Should be able to create a N-N swap with ERC20", async function () { @@ -128,7 +128,7 @@ describe("Swaplace", async function () { await expect(await Swaplace.connect(owner).createSwap(swap)) .to.emit(Swaplace, "SwapCreated") - .withArgs(await Swaplace.totalSwaps(), owner.address, swap.expiry); + .withArgs(await Swaplace.totalSwaps(), owner.address, swap.allowed, swap.expiry); }); it("Should be able to create a 1-1 swap with ERC721", async function () { @@ -150,7 +150,7 @@ describe("Swaplace", async function () { await expect(await Swaplace.connect(owner).createSwap(swap)) .to.emit(Swaplace, "SwapCreated") - .withArgs(await Swaplace.totalSwaps(), owner.address, swap.expiry); + .withArgs(await Swaplace.totalSwaps(), owner.address, swap.allowed, swap.expiry); }); it("Should be able to create a 1-N swap with ERC721", async function () { @@ -176,7 +176,7 @@ describe("Swaplace", async function () { await expect(await Swaplace.connect(owner).createSwap(swap)) .to.emit(Swaplace, "SwapCreated") - .withArgs(await Swaplace.totalSwaps(), owner.address, swap.expiry); + .withArgs(await Swaplace.totalSwaps(), owner.address, swap.allowed, swap.expiry); }); it("Should be able to create a N-N swap with ERC721", async function () { @@ -206,7 +206,7 @@ describe("Swaplace", async function () { await expect(await Swaplace.connect(owner).createSwap(swap)) .to.emit(Swaplace, "SwapCreated") - .withArgs(await Swaplace.totalSwaps(), owner.address, swap.expiry); + .withArgs(await Swaplace.totalSwaps(), owner.address, swap.allowed, swap.expiry); }); }); @@ -302,7 +302,7 @@ describe("Swaplace", async function () { await expect(await Swaplace.connect(owner).createSwap(swap)) .to.emit(Swaplace, "SwapCreated") - .withArgs(await Swaplace.totalSwaps(), owner.address, swap.expiry); + .withArgs(await Swaplace.totalSwaps(), owner.address, swap.allowed, swap.expiry); await expect( await Swaplace.connect(acceptee).acceptSwap( @@ -325,7 +325,7 @@ describe("Swaplace", async function () { await expect(await Swaplace.connect(owner).createSwap(swap)) .to.emit(Swaplace, "SwapCreated") - .withArgs(await Swaplace.totalSwaps(), owner.address, swap.expiry); + .withArgs(await Swaplace.totalSwaps(), owner.address, swap.allowed, swap.expiry); await expect( await Swaplace.connect(acceptee).acceptSwap( @@ -390,7 +390,7 @@ describe("Swaplace", async function () { await expect(await Swaplace.connect(owner).createSwap(swap)) .to.emit(Swaplace, "SwapCreated") - .withArgs(await Swaplace.totalSwaps(), owner.address, swap.expiry); + .withArgs(await Swaplace.totalSwaps(), owner.address, swap.allowed, swap.expiry); await expect( Swaplace.connect(acceptee).acceptSwap(await Swaplace.totalSwaps()),