Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preset completed event to max balance module #225

Merged
merged 3 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Change Log
All notable changes to this project will be documented in this file.

## [4.1.5]

### Added

- Added **PresetCompleted** event to MaxBalanceModule, which is triggered when the presetCompleted function is called.

## [4.1.4]

### Added
Expand Down
3 changes: 3 additions & 0 deletions contracts/compliance/modular/modules/MaxBalanceModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ contract MaxBalanceModule is AbstractModuleUpgradeable {

event IDBalancePreSet(address indexed _compliance, address indexed _id, uint256 _balance);

event PresetCompleted(address indexed _compliance);

/// errors
error MaxBalanceExceeded(address _compliance, uint256 _value);

Expand Down Expand Up @@ -184,6 +186,7 @@ contract MaxBalanceModule is AbstractModuleUpgradeable {
}

_compliancePresetStatus[_compliance] = true;
emit PresetCompleted(_compliance);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tokenysolutions/t-rex",
"version": "4.1.4",
"version": "4.1.5",
"description": "A fully compliant environment for the issuance and use of tokenized securities.",
"main": "index.js",
"directories": {
Expand Down
4 changes: 2 additions & 2 deletions test/compliances/module-max-balance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ describe('Compliance Module: MaxBalance', () => {
const context = await loadFixture(deployComplianceFixture);
const complianceModule = await ethers.deployContract('MaxBalanceModule');

await complianceModule.connect(context.accounts.deployer).presetCompleted(context.suite.compliance.address);

const tx = await complianceModule.connect(context.accounts.deployer).presetCompleted(context.suite.compliance.address);
await expect(tx).to.emit(complianceModule, 'PresetCompleted').withArgs(context.suite.compliance.address);
expect(await complianceModule.canComplianceBind(context.suite.compliance.address)).to.be.true;
});
});
Expand Down
Loading