Skip to content

Commit

Permalink
Create share event add decline ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
catel committed Sep 6, 2023
1 parent d4ea18f commit c9cb0d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions contracts/TrendsSharesV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ contract TrendsSharesV1 is Ownable {
error InvalidParams();
error InvalidDeclineRatio();

event Create(address creator, bytes32 subject, uint256 ethFee);
event Create(address creator, bytes32 subject, uint24 declineRatio, uint256 ethFee);

event Trade(
address trader,
Expand Down Expand Up @@ -80,7 +80,7 @@ contract TrendsSharesV1 is Ownable {
if (declineRatio * (1 ether / declineRatio) != 1 ether) revert InvalidDeclineRatio();
// Make sure declineRatio is fully divided in calculation later
sharesDeclineRatio[subject] = declineRatio;
emit Create(msg.sender, subject, msg.value);
emit Create(msg.sender, subject, declineRatio, msg.value);
_buyShares(msg.sender, subject, 1, 0);
(bool success, ) = devFundDestination.call{value: msg.value}("");
if (!success) revert UnableSendDevFund();
Expand Down
2 changes: 1 addition & 1 deletion test/TrendsSharesV1.shares.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ contract('TrendsSharesV1', function (accounts) {
});
it('create shares emit event', async function () {
expectEvent(createTxReceipt, 'Create', {
creator: creator1, subject: subject0, ethFee: createSharesEthFee
creator: creator1, subject: subject0, declineRatio: new BN(declineRatio), ethFee: createSharesEthFee
});
expectEvent(createTxReceipt, 'Trade', {
trader: creator1,
Expand Down

0 comments on commit c9cb0d1

Please sign in to comment.