-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* init module tests + debug * refactored & coverage 100% * fix * refactored example & bumped version * fix * typo lic
- Loading branch information
Showing
40 changed files
with
11,499 additions
and
387 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {TokenF} from "../../core/TokenF.sol"; | ||
import {AbstractRegulatoryModule} from "../../modules/AbstractRegulatoryModule.sol"; | ||
import {AbstractKYCModule} from "../../modules/AbstractKYCModule.sol"; | ||
|
||
contract ModuleMock is AbstractRegulatoryModule, AbstractKYCModule { | ||
bytes32 public constant MOCK_TOPIC = keccak256("MOCK"); | ||
|
||
function __ModuleMock_init(address tokenF_) external initializer { | ||
__AbstractModule_init(tokenF_); | ||
__AbstractRegulatoryModule_init(); | ||
__AbstractKYCModule_init(); | ||
} | ||
|
||
function _handlerer() internal override {} | ||
|
||
function handlerer() external { | ||
_setHandler(MOCK_TOPIC, _handleMockTopic); | ||
} | ||
|
||
function __AbstractModuleDirect_init() external { | ||
__AbstractModule_init(address(0)); | ||
} | ||
|
||
function __AbstractRegulatoryModuleDirect_init() external { | ||
__AbstractRegulatoryModule_init(); | ||
} | ||
|
||
function __AbstractKYCModuleDirect_init() external { | ||
__AbstractKYCModule_init(); | ||
} | ||
|
||
function getClaimTopicKey(bytes4 selector_) external view returns (bytes32) { | ||
TokenF.Context memory ctx_; | ||
ctx_.selector = selector_; | ||
|
||
return _getClaimTopicKey(ctx_); | ||
} | ||
|
||
function _handleMockTopic(TokenF.Context memory ctx_) internal view virtual returns (bool) { | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.20; | ||
|
||
import {TokenF} from "../../../core/TokenF.sol"; | ||
import {RarimoModule} from "../../../modules/kyc/RarimoModule.sol"; | ||
|
||
contract RarimoModuleMock is RarimoModule { | ||
function __RarimoModuleMock_init(address tokenF_, address sbt_) external initializer { | ||
__AbstractModule_init(tokenF_); | ||
__AbstractKYCModule_init(); | ||
__RarimoModule_init(sbt_); | ||
} | ||
|
||
function __RarimoModuleDirect_init() external { | ||
__RarimoModule_init(address(0)); | ||
} | ||
|
||
function getClaimTopicKey(bytes4 selector_) external view returns (bytes32) { | ||
TokenF.Context memory ctx_; | ||
ctx_.selector = selector_; | ||
|
||
return _getClaimTopicKey(ctx_); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.20; | ||
|
||
import {SBT} from "@solarity/solidity-lib/tokens/SBT.sol"; | ||
|
||
contract SBTMock is SBT { | ||
function __SBTMock_init() external initializer { | ||
__SBT_init("MockSBT", "MockSBT"); | ||
} | ||
|
||
function mint(address to_, uint256 tokenId_) external { | ||
_mint(to_, tokenId_); | ||
} | ||
|
||
function burn(uint256 tokenId_) external { | ||
_burn(tokenId_); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
contracts/mock/modules/regulatory/TransferLimitsModuleMock.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.20; | ||
|
||
import {TokenF} from "../../../core/TokenF.sol"; | ||
import {TransferLimitsModule} from "../../../modules/regulatory/TransferLimitsModule.sol"; | ||
|
||
contract TransferLimitsModuleMock is TransferLimitsModule { | ||
function __TransferLimitsModuleMock_init( | ||
address tokenF_, | ||
uint256 minTransferValue_, | ||
uint256 maxTransferValue_ | ||
) external initializer { | ||
__AbstractModule_init(tokenF_); | ||
__AbstractRegulatoryModule_init(); | ||
__TransferLimitsModule_init(minTransferValue_, maxTransferValue_); | ||
} | ||
|
||
function __TransferLimitsDirect_init() external { | ||
__TransferLimitsModule_init(0, 0); | ||
} | ||
|
||
function __AbstractModuleDirect_init() external { | ||
__AbstractModule_init(address(0)); | ||
} | ||
|
||
function __AbstractRegulatoryModuleDirect_init() external { | ||
__AbstractRegulatoryModule_init(); | ||
} | ||
|
||
function getClaimTopicKey(bytes4 selector_) external view returns (bytes32) { | ||
TokenF.Context memory ctx_; | ||
ctx_.selector = selector_; | ||
|
||
return _getClaimTopicKey(ctx_); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.