├── .gitmodules ├── lib ├── forge-std │ ├── .gitattributes │ ├── .gitignore │ ├── test │ │ ├── fixtures │ │ │ ├── test.toml │ │ │ └── test.json │ │ ├── compilation │ │ │ ├── CompilationTest.sol │ │ │ ├── CompilationScript.sol │ │ │ ├── CompilationTestBase.sol │ │ │ └── CompilationScriptBase.sol │ │ └── Vm.t.sol │ ├── src │ │ ├── console2.sol │ │ ├── interfaces │ │ │ └── IERC165.sol │ │ └── Script.sol │ ├── package.json │ ├── foundry.toml │ └── .github │ │ └── workflows │ │ └── sync.yml └── tm-tokenmaster │ ├── lib │ ├── TrustedForwarder │ │ ├── remappings.txt │ │ ├── lib │ │ │ └── openzeppelin-contracts │ │ │ │ └── contracts │ │ │ │ ├── mocks │ │ │ │ ├── ERC165 │ │ │ │ │ ├── ERC165NotSupported.sol │ │ │ │ │ ├── ERC165MissingData.sol │ │ │ │ │ ├── ERC165MaliciousData.sol │ │ │ │ │ └── ERC165ReturnBomb.sol │ │ │ │ ├── token │ │ │ │ │ ├── ERC20MulticallMock.sol │ │ │ │ │ ├── ERC20ExcessDecimalsMock.sol │ │ │ │ │ ├── ERC777Mock.sol │ │ │ │ │ ├── ERC20DecimalsMock.sol │ │ │ │ │ ├── ERC4626OffsetMock.sol │ │ │ │ │ ├── ERC721URIStorageMock.sol │ │ │ │ │ ├── ERC20ForceApproveMock.sol │ │ │ │ │ ├── ERC20ReturnFalseMock.sol │ │ │ │ │ ├── ERC20FlashMintMock.sol │ │ │ │ │ └── ERC20NoReturnMock.sol │ │ │ │ ├── proxy │ │ │ │ │ ├── BadBeacon.sol │ │ │ │ │ └── ClashingImplementation.sol │ │ │ │ ├── AccessControlCrossChainMock.sol │ │ │ │ ├── ReentrancyAttack.sol │ │ │ │ ├── EtherReceiverMock.sol │ │ │ │ ├── PullPaymentMock.sol │ │ │ │ ├── ERC20Mock.sol │ │ │ │ ├── ERC4626Mock.sol │ │ │ │ ├── ConditionalEscrowMock.sol │ │ │ │ ├── governance │ │ │ │ │ ├── GovernorVoteMock.sol │ │ │ │ │ └── GovernorCompMock.sol │ │ │ │ ├── EIP712Verifier.sol │ │ │ │ ├── PausableMock.sol │ │ │ │ ├── TimelockReentrant.sol │ │ │ │ ├── MulticallTest.sol │ │ │ │ └── ERC2771ContextMock.sol │ │ │ │ ├── token │ │ │ │ ├── ERC20 │ │ │ │ │ ├── presets │ │ │ │ │ │ └── README.md │ │ │ │ │ └── extensions │ │ │ │ │ │ ├── draft-ERC20Permit.sol │ │ │ │ │ │ ├── draft-IERC20Permit.sol │ │ │ │ │ │ └── IERC20Metadata.sol │ │ │ │ ├── ERC1155 │ │ │ │ │ ├── presets │ │ │ │ │ │ └── README.md │ │ │ │ │ ├── utils │ │ │ │ │ │ └── ERC1155Receiver.sol │ │ │ │ │ └── extensions │ │ │ │ │ │ └── IERC1155MetadataURI.sol │ │ │ │ ├── ERC721 │ │ │ │ │ ├── presets │ │ │ │ │ │ └── README.md │ │ │ │ │ ├── extensions │ │ │ │ │ │ ├── draft-ERC721Votes.sol │ │ │ │ │ │ ├── IERC721Metadata.sol │ │ │ │ │ │ └── ERC721Burnable.sol │ │ │ │ │ └── utils │ │ │ │ │ │ └── ERC721Holder.sol │ │ │ │ └── common │ │ │ │ │ └── README.adoc │ │ │ │ ├── interfaces │ │ │ │ ├── IERC20.sol │ │ │ │ ├── IERC721.sol │ │ │ │ ├── IERC777.sol │ │ │ │ ├── IERC1155.sol │ │ │ │ ├── IERC165.sol │ │ │ │ ├── IERC777Sender.sol │ │ │ │ ├── IERC721Receiver.sol │ │ │ │ ├── IERC1155Receiver.sol │ │ │ │ ├── IERC20Metadata.sol │ │ │ │ ├── IERC777Recipient.sol │ │ │ │ ├── IERC1820Registry.sol │ │ │ │ ├── IERC721Metadata.sol │ │ │ │ ├── IERC721Enumerable.sol │ │ │ │ ├── IERC1820Implementer.sol │ │ │ │ ├── IERC3156.sol │ │ │ │ ├── IERC1155MetadataURI.sol │ │ │ │ ├── IERC2612.sol │ │ │ │ ├── draft-IERC2612.sol │ │ │ │ ├── IERC5805.sol │ │ │ │ ├── IERC5313.sol │ │ │ │ ├── IERC6372.sol │ │ │ │ ├── IERC2309.sol │ │ │ │ ├── IERC1271.sol │ │ │ │ ├── IERC1967.sol │ │ │ │ ├── IERC5267.sol │ │ │ │ └── IERC4906.sol │ │ │ │ ├── crosschain │ │ │ │ └── errors.sol │ │ │ │ ├── metatx │ │ │ │ └── README.adoc │ │ │ │ ├── utils │ │ │ │ ├── cryptography │ │ │ │ │ └── draft-EIP712.sol │ │ │ │ ├── introspection │ │ │ │ │ └── IERC1820Implementer.sol │ │ │ │ └── Multicall.sol │ │ │ │ ├── vendor │ │ │ │ ├── polygon │ │ │ │ │ └── IFxMessageProcessor.sol │ │ │ │ └── arbitrum │ │ │ │ │ └── IDelayedMessageProvider.sol │ │ │ │ ├── proxy │ │ │ │ └── beacon │ │ │ │ │ └── IBeacon.sol │ │ │ │ ├── security │ │ │ │ └── README.adoc │ │ │ │ ├── governance │ │ │ │ └── extensions │ │ │ │ │ ├── GovernorProposalThreshold.sol │ │ │ │ │ └── IGovernorTimelock.sol │ │ │ │ └── finance │ │ │ │ └── README.adoc │ │ ├── foundry.toml │ │ └── src │ │ │ └── interfaces │ │ │ └── ITrustedForwarderFactory.sol │ ├── tm-role-server │ │ ├── remappings.txt │ │ ├── lib │ │ │ └── tm-core-lib │ │ │ │ ├── src │ │ │ │ └── utils │ │ │ │ │ └── security │ │ │ │ │ └── IRoleClient.sol │ │ │ │ └── foundry.toml │ │ └── foundry.toml │ ├── PermitC │ │ ├── lib │ │ │ └── openzeppelin-contracts │ │ │ │ └── contracts │ │ │ │ ├── mocks │ │ │ │ ├── ERC165 │ │ │ │ │ ├── ERC165NotSupported.sol │ │ │ │ │ ├── ERC165MissingData.sol │ │ │ │ │ ├── ERC165MaliciousData.sol │ │ │ │ │ └── ERC165ReturnBomb.sol │ │ │ │ ├── token │ │ │ │ │ ├── ERC20MulticallMock.sol │ │ │ │ │ ├── ERC20ExcessDecimalsMock.sol │ │ │ │ │ ├── ERC777Mock.sol │ │ │ │ │ ├── ERC20DecimalsMock.sol │ │ │ │ │ ├── ERC4626OffsetMock.sol │ │ │ │ │ ├── ERC721URIStorageMock.sol │ │ │ │ │ ├── ERC20ForceApproveMock.sol │ │ │ │ │ ├── ERC20ReturnFalseMock.sol │ │ │ │ │ ├── ERC20FlashMintMock.sol │ │ │ │ │ └── ERC20NoReturnMock.sol │ │ │ │ ├── proxy │ │ │ │ │ ├── BadBeacon.sol │ │ │ │ │ └── ClashingImplementation.sol │ │ │ │ ├── AccessControlCrossChainMock.sol │ │ │ │ ├── ReentrancyAttack.sol │ │ │ │ ├── EtherReceiverMock.sol │ │ │ │ ├── PullPaymentMock.sol │ │ │ │ ├── ERC20Mock.sol │ │ │ │ ├── ERC4626Mock.sol │ │ │ │ ├── ConditionalEscrowMock.sol │ │ │ │ ├── governance │ │ │ │ │ ├── GovernorVoteMock.sol │ │ │ │ │ └── GovernorCompMock.sol │ │ │ │ ├── EIP712Verifier.sol │ │ │ │ ├── PausableMock.sol │ │ │ │ ├── TimelockReentrant.sol │ │ │ │ ├── MulticallTest.sol │ │ │ │ └── ERC2771ContextMock.sol │ │ │ │ ├── token │ │ │ │ ├── ERC1155 │ │ │ │ │ ├── presets │ │ │ │ │ │ └── README.md │ │ │ │ │ ├── utils │ │ │ │ │ │ └── ERC1155Receiver.sol │ │ │ │ │ └── extensions │ │ │ │ │ │ └── IERC1155MetadataURI.sol │ │ │ │ ├── ERC20 │ │ │ │ │ ├── presets │ │ │ │ │ │ └── README.md │ │ │ │ │ └── extensions │ │ │ │ │ │ ├── draft-ERC20Permit.sol │ │ │ │ │ │ ├── draft-IERC20Permit.sol │ │ │ │ │ │ └── IERC20Metadata.sol │ │ │ │ ├── ERC721 │ │ │ │ │ ├── presets │ │ │ │ │ │ └── README.md │ │ │ │ │ ├── extensions │ │ │ │ │ │ ├── draft-ERC721Votes.sol │ │ │ │ │ │ ├── IERC721Metadata.sol │ │ │ │ │ │ └── ERC721Burnable.sol │ │ │ │ │ └── utils │ │ │ │ │ │ └── ERC721Holder.sol │ │ │ │ └── common │ │ │ │ │ └── README.adoc │ │ │ │ ├── interfaces │ │ │ │ ├── IERC20.sol │ │ │ │ ├── IERC721.sol │ │ │ │ ├── IERC777.sol │ │ │ │ ├── IERC1155.sol │ │ │ │ ├── IERC165.sol │ │ │ │ ├── IERC777Sender.sol │ │ │ │ ├── IERC721Receiver.sol │ │ │ │ ├── IERC1155Receiver.sol │ │ │ │ ├── IERC777Recipient.sol │ │ │ │ ├── IERC1820Registry.sol │ │ │ │ ├── IERC20Metadata.sol │ │ │ │ ├── IERC721Metadata.sol │ │ │ │ ├── IERC1820Implementer.sol │ │ │ │ ├── IERC3156.sol │ │ │ │ ├── IERC721Enumerable.sol │ │ │ │ ├── IERC1155MetadataURI.sol │ │ │ │ ├── IERC2612.sol │ │ │ │ ├── draft-IERC2612.sol │ │ │ │ ├── IERC5805.sol │ │ │ │ ├── IERC5313.sol │ │ │ │ ├── IERC6372.sol │ │ │ │ ├── IERC2309.sol │ │ │ │ ├── IERC1271.sol │ │ │ │ ├── IERC1967.sol │ │ │ │ ├── IERC5267.sol │ │ │ │ └── IERC4906.sol │ │ │ │ ├── metatx │ │ │ │ └── README.adoc │ │ │ │ ├── crosschain │ │ │ │ └── errors.sol │ │ │ │ ├── utils │ │ │ │ ├── cryptography │ │ │ │ │ └── draft-EIP712.sol │ │ │ │ ├── introspection │ │ │ │ │ └── IERC1820Implementer.sol │ │ │ │ ├── Multicall.sol │ │ │ │ └── Context.sol │ │ │ │ ├── vendor │ │ │ │ ├── polygon │ │ │ │ │ └── IFxMessageProcessor.sol │ │ │ │ └── arbitrum │ │ │ │ │ └── IDelayedMessageProvider.sol │ │ │ │ ├── proxy │ │ │ │ └── beacon │ │ │ │ │ └── IBeacon.sol │ │ │ │ ├── security │ │ │ │ └── README.adoc │ │ │ │ ├── governance │ │ │ │ └── extensions │ │ │ │ │ ├── GovernorProposalThreshold.sol │ │ │ │ │ └── IGovernorTimelock.sol │ │ │ │ ├── finance │ │ │ │ └── README.adoc │ │ │ │ ├── access │ │ │ │ └── README.adoc │ │ │ │ └── package.json │ │ ├── foundry.toml │ │ ├── remappings.txt │ │ └── src │ │ │ └── DataTypes.sol │ ├── tm-core-lib │ │ ├── src │ │ │ ├── utils │ │ │ │ ├── extensibility │ │ │ │ │ ├── IExtension.sol │ │ │ │ │ ├── Constants.sol │ │ │ │ │ └── IExtensible.sol │ │ │ │ ├── security │ │ │ │ │ ├── IRoleClient.sol │ │ │ │ │ ├── IRoleServer.sol │ │ │ │ │ ├── RoleClient.sol │ │ │ │ │ └── RoleSetClient.sol │ │ │ │ ├── access │ │ │ │ │ ├── OwnablePermissions.sol │ │ │ │ │ ├── OwnableBasic.sol │ │ │ │ │ └── Ownable2StepBasic.sol │ │ │ │ ├── token │ │ │ │ │ ├── ITransferValidatorSetTokenType.sol │ │ │ │ │ ├── IEOARegistry.sol │ │ │ │ │ ├── ICreatorTokenLegacy.sol │ │ │ │ │ ├── ICreatorToken.sol │ │ │ │ │ └── Constants.sol │ │ │ │ ├── cryptography │ │ │ │ │ └── DataTypes.sol │ │ │ │ ├── Errors.sol │ │ │ │ ├── misc │ │ │ │ │ └── StorageTstorish.sol │ │ │ │ └── introspection │ │ │ │ │ ├── IERC165.sol │ │ │ │ │ └── ERC165.sol │ │ │ └── token │ │ │ │ ├── common │ │ │ │ ├── IExtensionERC2981.sol │ │ │ │ └── IERC2981.sol │ │ │ │ ├── erc1155 │ │ │ │ ├── StorageERC1155.sol │ │ │ │ └── IERC1155MetadataURI.sol │ │ │ │ ├── erc721 │ │ │ │ ├── StorageERC721.sol │ │ │ │ └── IERC721Metadata.sol │ │ │ │ └── erc20 │ │ │ │ └── IERC20Metadata.sol │ │ └── foundry.toml │ └── creator-token-transfer-validator │ │ ├── remappings.txt │ │ ├── lib │ │ ├── PermitC │ │ │ ├── lib │ │ │ │ └── openzeppelin-contracts │ │ │ │ │ └── contracts │ │ │ │ │ ├── mocks │ │ │ │ │ ├── ERC165 │ │ │ │ │ │ ├── ERC165NotSupported.sol │ │ │ │ │ │ ├── ERC165MissingData.sol │ │ │ │ │ │ ├── ERC165MaliciousData.sol │ │ │ │ │ │ └── ERC165ReturnBomb.sol │ │ │ │ │ ├── token │ │ │ │ │ │ ├── ERC20MulticallMock.sol │ │ │ │ │ │ ├── ERC20ExcessDecimalsMock.sol │ │ │ │ │ │ ├── ERC777Mock.sol │ │ │ │ │ │ ├── ERC20DecimalsMock.sol │ │ │ │ │ │ ├── ERC4626OffsetMock.sol │ │ │ │ │ │ ├── ERC721URIStorageMock.sol │ │ │ │ │ │ ├── ERC20ForceApproveMock.sol │ │ │ │ │ │ ├── ERC20ReturnFalseMock.sol │ │ │ │ │ │ ├── ERC20FlashMintMock.sol │ │ │ │ │ │ └── ERC20NoReturnMock.sol │ │ │ │ │ ├── proxy │ │ │ │ │ │ ├── BadBeacon.sol │ │ │ │ │ │ └── ClashingImplementation.sol │ │ │ │ │ ├── AccessControlCrossChainMock.sol │ │ │ │ │ ├── ReentrancyAttack.sol │ │ │ │ │ ├── EtherReceiverMock.sol │ │ │ │ │ ├── PullPaymentMock.sol │ │ │ │ │ ├── ERC20Mock.sol │ │ │ │ │ ├── ERC4626Mock.sol │ │ │ │ │ ├── ConditionalEscrowMock.sol │ │ │ │ │ ├── governance │ │ │ │ │ │ ├── GovernorVoteMock.sol │ │ │ │ │ │ └── GovernorCompMock.sol │ │ │ │ │ ├── EIP712Verifier.sol │ │ │ │ │ ├── PausableMock.sol │ │ │ │ │ ├── TimelockReentrant.sol │ │ │ │ │ ├── MulticallTest.sol │ │ │ │ │ └── ERC2771ContextMock.sol │ │ │ │ │ ├── token │ │ │ │ │ ├── ERC1155 │ │ │ │ │ │ ├── presets │ │ │ │ │ │ │ └── README.md │ │ │ │ │ │ ├── utils │ │ │ │ │ │ │ └── ERC1155Receiver.sol │ │ │ │ │ │ └── extensions │ │ │ │ │ │ │ └── IERC1155MetadataURI.sol │ │ │ │ │ ├── ERC20 │ │ │ │ │ │ ├── presets │ │ │ │ │ │ │ └── README.md │ │ │ │ │ │ └── extensions │ │ │ │ │ │ │ ├── draft-ERC20Permit.sol │ │ │ │ │ │ │ ├── draft-IERC20Permit.sol │ │ │ │ │ │ │ └── IERC20Metadata.sol │ │ │ │ │ ├── ERC721 │ │ │ │ │ │ ├── presets │ │ │ │ │ │ │ └── README.md │ │ │ │ │ │ ├── extensions │ │ │ │ │ │ │ ├── draft-ERC721Votes.sol │ │ │ │ │ │ │ └── IERC721Metadata.sol │ │ │ │ │ │ └── utils │ │ │ │ │ │ │ └── ERC721Holder.sol │ │ │ │ │ └── common │ │ │ │ │ │ └── README.adoc │ │ │ │ │ ├── interfaces │ │ │ │ │ ├── IERC20.sol │ │ │ │ │ ├── IERC721.sol │ │ │ │ │ ├── IERC777.sol │ │ │ │ │ ├── IERC1155.sol │ │ │ │ │ ├── IERC165.sol │ │ │ │ │ ├── IERC777Sender.sol │ │ │ │ │ ├── IERC1155Receiver.sol │ │ │ │ │ ├── IERC721Receiver.sol │ │ │ │ │ ├── IERC777Recipient.sol │ │ │ │ │ ├── IERC20Metadata.sol │ │ │ │ │ ├── IERC1820Registry.sol │ │ │ │ │ ├── IERC721Metadata.sol │ │ │ │ │ ├── IERC1820Implementer.sol │ │ │ │ │ ├── IERC3156.sol │ │ │ │ │ ├── IERC721Enumerable.sol │ │ │ │ │ ├── IERC1155MetadataURI.sol │ │ │ │ │ ├── IERC2612.sol │ │ │ │ │ ├── draft-IERC2612.sol │ │ │ │ │ ├── IERC5805.sol │ │ │ │ │ ├── IERC5313.sol │ │ │ │ │ ├── IERC6372.sol │ │ │ │ │ ├── IERC2309.sol │ │ │ │ │ ├── IERC1271.sol │ │ │ │ │ ├── IERC1967.sol │ │ │ │ │ ├── IERC5267.sol │ │ │ │ │ └── IERC4906.sol │ │ │ │ │ ├── crosschain │ │ │ │ │ └── errors.sol │ │ │ │ │ ├── metatx │ │ │ │ │ └── README.adoc │ │ │ │ │ ├── utils │ │ │ │ │ ├── cryptography │ │ │ │ │ │ └── draft-EIP712.sol │ │ │ │ │ ├── introspection │ │ │ │ │ │ └── IERC1820Implementer.sol │ │ │ │ │ └── Multicall.sol │ │ │ │ │ ├── vendor │ │ │ │ │ ├── polygon │ │ │ │ │ │ └── IFxMessageProcessor.sol │ │ │ │ │ └── arbitrum │ │ │ │ │ │ └── IDelayedMessageProvider.sol │ │ │ │ │ ├── proxy │ │ │ │ │ └── beacon │ │ │ │ │ │ └── IBeacon.sol │ │ │ │ │ ├── security │ │ │ │ │ └── README.adoc │ │ │ │ │ ├── governance │ │ │ │ │ └── extensions │ │ │ │ │ │ ├── GovernorProposalThreshold.sol │ │ │ │ │ │ └── IGovernorTimelock.sol │ │ │ │ │ └── finance │ │ │ │ │ └── README.adoc │ │ │ └── src │ │ │ │ └── DataTypes.sol │ │ └── tm-core-lib │ │ │ └── src │ │ │ └── utils │ │ │ ├── token │ │ │ └── IEOARegistry.sol │ │ │ ├── misc │ │ │ └── StorageTstorish.sol │ │ │ └── introspection │ │ │ ├── IERC165.sol │ │ │ └── ERC165.sol │ │ ├── foundry.toml │ │ └── src │ │ └── DataTypes.sol │ ├── images │ ├── call_flow.png │ ├── hook_flow.png │ ├── stable_pool_flow.png │ ├── stable_pool_settings.png │ ├── standard_pool_flow.png │ ├── standard_pool_settings.png │ ├── high_level_architecture.png │ ├── stable_pool_market_value.png │ └── standard_pool_market_value.png │ ├── test │ ├── invariants │ │ ├── ForcePush.sol │ │ └── Uint256Set.sol │ └── mocks │ │ └── MockPairedTokenERC20.sol │ ├── remappings.txt │ ├── foundry.toml │ └── src │ ├── interfaces │ ├── IMinterBurnerRolePool.sol │ ├── ITokenMasterBuyHook.sol │ ├── ITokenMasterSellHook.sol │ ├── ITokenMasterSpendHook.sol │ ├── ITokenMasterOracle.sol │ └── ITokenMasterFactory.sol │ └── pools │ ├── promotional-pool │ ├── IPromotionalPool.sol │ └── PromotionalPoolCreationCode.sol │ ├── stable-pool │ └── StablePoolCreationCode.sol │ └── standard-token-pool │ └── StandardPoolCreationCode.sol ├── remappings.txt ├── .gitignore ├── test └── helpers │ └── Random.sol ├── foundry.toml └── .github └── workflows └── test.yml /.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/forge-std/.gitattributes: -------------------------------------------------------------------------------- 1 | src/Vm.sol linguist-generated 2 | -------------------------------------------------------------------------------- /lib/forge-std/.gitignore: -------------------------------------------------------------------------------- 1 | cache/ 2 | out/ 3 | .vscode 4 | .idea 5 | -------------------------------------------------------------------------------- /lib/forge-std/test/fixtures/test.toml: -------------------------------------------------------------------------------- 1 | a = 123 2 | b = "test" 3 | 4 | [c] 5 | a = 123 6 | b = "test" 7 | -------------------------------------------------------------------------------- /remappings.txt: -------------------------------------------------------------------------------- 1 | @limitbreak/tokenmaster/=lib/tm-tokenmaster/ 2 | @limitbreak/tm-core-lib/=lib/tm-tokenmaster/lib/tm-core-lib/ -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/remappings.txt: -------------------------------------------------------------------------------- 1 | forge-std/=lib/forge-std/src/ 2 | @openzeppelin/=lib/openzeppelin-contracts/ -------------------------------------------------------------------------------- /lib/forge-std/test/fixtures/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "a": 123, 3 | "b": "test", 4 | "c": { 5 | "a": 123, 6 | "b": "test" 7 | } 8 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/images/call_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limitbreakinc/tm-tokenmaster-examples/HEAD/lib/tm-tokenmaster/images/call_flow.png -------------------------------------------------------------------------------- /lib/tm-tokenmaster/images/hook_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limitbreakinc/tm-tokenmaster-examples/HEAD/lib/tm-tokenmaster/images/hook_flow.png -------------------------------------------------------------------------------- /lib/forge-std/src/console2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.4.22 <0.9.0; 3 | 4 | import {console as console2} from "./console.sol"; 5 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/images/stable_pool_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limitbreakinc/tm-tokenmaster-examples/HEAD/lib/tm-tokenmaster/images/stable_pool_flow.png -------------------------------------------------------------------------------- /lib/tm-tokenmaster/images/stable_pool_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limitbreakinc/tm-tokenmaster-examples/HEAD/lib/tm-tokenmaster/images/stable_pool_settings.png -------------------------------------------------------------------------------- /lib/tm-tokenmaster/images/standard_pool_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limitbreakinc/tm-tokenmaster-examples/HEAD/lib/tm-tokenmaster/images/standard_pool_flow.png -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-role-server/remappings.txt: -------------------------------------------------------------------------------- 1 | ds-test/=lib/forge-std/lib/ds-test/src/ 2 | forge-std/=lib/forge-std/src/ 3 | @limitbreak/tm-core-lib/=lib/tm-core-lib/ -------------------------------------------------------------------------------- /lib/tm-tokenmaster/images/standard_pool_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limitbreakinc/tm-tokenmaster-examples/HEAD/lib/tm-tokenmaster/images/standard_pool_settings.png -------------------------------------------------------------------------------- /lib/tm-tokenmaster/images/high_level_architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limitbreakinc/tm-tokenmaster-examples/HEAD/lib/tm-tokenmaster/images/high_level_architecture.png -------------------------------------------------------------------------------- /lib/tm-tokenmaster/images/stable_pool_market_value.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limitbreakinc/tm-tokenmaster-examples/HEAD/lib/tm-tokenmaster/images/stable_pool_market_value.png -------------------------------------------------------------------------------- /lib/tm-tokenmaster/images/standard_pool_market_value.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limitbreakinc/tm-tokenmaster-examples/HEAD/lib/tm-tokenmaster/images/standard_pool_market_value.png -------------------------------------------------------------------------------- /lib/tm-tokenmaster/test/invariants/ForcePush.sol: -------------------------------------------------------------------------------- 1 | pragma solidity 0.8.24; 2 | 3 | contract ForcePush { 4 | constructor(address dst) payable { 5 | selfdestruct(payable(dst)); 6 | } 7 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165NotSupported.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract ERC165NotSupported {} 6 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/extensibility/IExtension.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | interface IExtension { 4 | function selectorManifest() external pure returns (bytes4[] memory); 5 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165NotSupported.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract ERC165NotSupported {} 6 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/security/IRoleClient.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | interface IRoleClient { 4 | function onRoleHolderChanged(bytes32 /*role*/, address /*roleHolder*/) external; 5 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/access/OwnablePermissions.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | abstract contract OwnablePermissions { 4 | function _requireCallerIsContractOwner() internal view virtual; 5 | } 6 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/remappings.txt: -------------------------------------------------------------------------------- 1 | ds-test/=lib/forge-std/lib/ds-test/src/ 2 | forge-std/=lib/forge-std/src/ 3 | @limitbreak/tm-core-lib/=lib/tm-core-lib/ 4 | @limitbreak/permit-c/=lib/PermitC/src/ -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC1155/presets/README.md: -------------------------------------------------------------------------------- 1 | Contract presets are now deprecated in favor of [Contracts Wizard](https://wizard.openzeppelin.com/) as a more powerful alternative. 2 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC20/presets/README.md: -------------------------------------------------------------------------------- 1 | Contract presets are now deprecated in favor of [Contracts Wizard](https://wizard.openzeppelin.com/) as a more powerful alternative. 2 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC721/presets/README.md: -------------------------------------------------------------------------------- 1 | Contract presets are now deprecated in favor of [Contracts Wizard](https://wizard.openzeppelin.com/) as a more powerful alternative. 2 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/token/ERC20/presets/README.md: -------------------------------------------------------------------------------- 1 | Contract presets are now deprecated in favor of [Contracts Wizard](https://wizard.openzeppelin.com/) as a more powerful alternative. 2 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-role-server/lib/tm-core-lib/src/utils/security/IRoleClient.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | interface IRoleClient { 4 | function onRoleHolderChanged(bytes32 /*role*/, address /*roleHolder*/) external; 5 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/token/ERC1155/presets/README.md: -------------------------------------------------------------------------------- 1 | Contract presets are now deprecated in favor of [Contracts Wizard](https://wizard.openzeppelin.com/) as a more powerful alternative. 2 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/token/ERC721/presets/README.md: -------------------------------------------------------------------------------- 1 | Contract presets are now deprecated in favor of [Contracts Wizard](https://wizard.openzeppelin.com/) as a more powerful alternative. 2 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165NotSupported.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract ERC165NotSupported {} 6 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/extensibility/Constants.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | uint256 constant EXTENSIBLE_TYPE_FT = 10020; 4 | uint256 constant EXTENSIBLE_TYPE_NFT = 10721; 5 | uint256 constant EXTENSIBLE_TYPE_SFT = 11155; 6 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/token/ITransferValidatorSetTokenType.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | interface ITransferValidatorSetTokenType { 4 | function setTokenTypeOfCollection(address collection, uint16 tokenType) external; 5 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC20/IERC20.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC721.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC721/IERC721.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC777.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC777.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC777/IERC777.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/token/IEOARegistry.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | import "../introspection/IERC165.sol"; 4 | 5 | interface IEOARegistry is IERC165 { 6 | function isVerifiedEOA(address account) external view returns (bool); 7 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC1155.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC1155/IERC1155.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC20/IERC20.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC1155/presets/README.md: -------------------------------------------------------------------------------- 1 | Contract presets are now deprecated in favor of [Contracts Wizard](https://wizard.openzeppelin.com/) as a more powerful alternative. 2 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC20/presets/README.md: -------------------------------------------------------------------------------- 1 | Contract presets are now deprecated in favor of [Contracts Wizard](https://wizard.openzeppelin.com/) as a more powerful alternative. 2 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC721/presets/README.md: -------------------------------------------------------------------------------- 1 | Contract presets are now deprecated in favor of [Contracts Wizard](https://wizard.openzeppelin.com/) as a more powerful alternative. 2 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = "src" 3 | out = "out" 4 | libs = ["lib"] 5 | 6 | solc_version = "0.8.24" 7 | 8 | optimizer = true 9 | optimizer_runs = 1000000 10 | 11 | [fuzz] 12 | runs = 256 13 | max_test_rejects = 10240000 -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../utils/introspection/IERC165.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC721.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC721/IERC721.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC777.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC777.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC777/IERC777.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC1155.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC1155/IERC1155.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC777Sender.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC777Sender.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC777/IERC777Sender.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../utils/introspection/IERC165.sol"; 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiler files 2 | cache/ 3 | out/ 4 | 5 | # Ignores development broadcast logs 6 | !/broadcast 7 | /broadcast/*/31337/ 8 | /broadcast/**/dry-run/ 9 | 10 | # Docs 11 | docs/ 12 | 13 | # Dotenv file 14 | .env 15 | lib/tm-tokenmaster/.DS_Store 16 | lib/.DS_Store 17 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC721Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Receiver.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC721/IERC721Receiver.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC1155Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155Receiver.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC1155/IERC1155Receiver.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC777Recipient.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC777Recipient.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC777/IERC777Recipient.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC777Sender.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC777Sender.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC777/IERC777Sender.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC1820Registry.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1820Registry.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../utils/introspection/IERC1820Registry.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC20Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20Metadata.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC20/extensions/IERC20Metadata.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC721Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Metadata.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC721/extensions/IERC721Metadata.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165MissingData.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract ERC165MissingData { 6 | function supportsInterface(bytes4 interfaceId) public view {} // missing return 7 | } 8 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC721Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Receiver.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC721/IERC721Receiver.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC20/IERC20.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC1155Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155Receiver.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC1155/IERC1155Receiver.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC20Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20Metadata.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC20/extensions/IERC20Metadata.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC777Recipient.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC777Recipient.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC777/IERC777Recipient.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC721.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC721/IERC721.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC777.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC777.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC777/IERC777.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/tm-core-lib/src/utils/token/IEOARegistry.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | import "../introspection/IERC165.sol"; 4 | 5 | interface IEOARegistry is IERC165 { 6 | function isVerifiedEOA(address account) external view returns (bool); 7 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC1820Implementer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1820Implementer.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../utils/introspection/IERC1820Implementer.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC3156.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC3156.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "./IERC3156FlashBorrower.sol"; 7 | import "./IERC3156FlashLender.sol"; 8 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC721Enumerable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Enumerable.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC721/extensions/IERC721Enumerable.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC1820Registry.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1820Registry.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../utils/introspection/IERC1820Registry.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC721Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Metadata.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC721/extensions/IERC721Metadata.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165MissingData.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract ERC165MissingData { 6 | function supportsInterface(bytes4 interfaceId) public view {} // missing return 7 | } 8 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC1155.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC1155/IERC1155.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../utils/introspection/IERC165.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = "src" 3 | out = "out" 4 | libs = ["lib"] 5 | 6 | solc_version = "0.8.24" 7 | evm_version = "cancun" 8 | 9 | # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options 10 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC1155MetadataURI.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155MetadataURI.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC1155/extensions/IERC1155MetadataURI.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/remappings.txt: -------------------------------------------------------------------------------- 1 | ds-test/=lib/forge-std/lib/ds-test/src/ 2 | erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/ 3 | forge-std/=lib/forge-std/src/ 4 | @openzeppelin/=lib/openzeppelin-contracts/ 5 | @rari-capital/solmate/=lib/solmate/ 6 | forge-gas-metering/=lib/forge-gas-metering/ -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC721Enumerable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Enumerable.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC721/extensions/IERC721Enumerable.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC1820Implementer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1820Implementer.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../utils/introspection/IERC1820Implementer.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC3156.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC3156.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "./IERC3156FlashBorrower.sol"; 7 | import "./IERC3156FlashLender.sol"; 8 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC777Sender.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC777Sender.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC777/IERC777Sender.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC20MulticallMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/ERC20.sol"; 6 | import "../../utils/Multicall.sol"; 7 | 8 | abstract contract ERC20MulticallMock is ERC20, Multicall {} 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC1155MetadataURI.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155MetadataURI.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC1155/extensions/IERC1155MetadataURI.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/security/IRoleServer.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | interface IRoleServer { 4 | function getRoleHolder(bytes32 /*role*/) external view returns (address); 5 | function setRoleHolder(bytes32 /*role*/, address /*authority*/, address[] calldata /*clients*/) external; 6 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/remappings.txt: -------------------------------------------------------------------------------- 1 | @limitbreak/tm-core-lib/=lib/tm-core-lib/ 2 | @limitbreak/permit-c/=lib/PermitC/src/ 3 | @limitbreak/trusted-forwarder/=lib/TrustedForwarder/src/ 4 | @limitbreak/tm-role-server/=lib/tm-role-server/src/ 5 | @limitbreak/creator-token-transfer-validator/=lib/creator-token-transfer-validator/src/ -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC1155Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155Receiver.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC1155/IERC1155Receiver.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC721Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Receiver.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC721/IERC721Receiver.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC777Recipient.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC777Recipient.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC777/IERC777Recipient.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-role-server/lib/tm-core-lib/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = "src" 3 | out = "out" 4 | libs = ["lib"] 5 | 6 | solc_version = "0.8.24" 7 | evm_version = "cancun" 8 | 9 | # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options 10 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/metatx/README.adoc: -------------------------------------------------------------------------------- 1 | = Meta Transactions 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/metatx 5 | 6 | == Core 7 | 8 | {{ERC2771Context}} 9 | 10 | == Utils 11 | 12 | {{MinimalForwarder}} 13 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/token/ERC20MulticallMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/ERC20.sol"; 6 | import "../../utils/Multicall.sol"; 7 | 8 | abstract contract ERC20MulticallMock is ERC20, Multicall {} 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC20Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20Metadata.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC20/extensions/IERC20Metadata.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/crosschain/errors.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.6.0) (crosschain/errors.sol) 3 | 4 | pragma solidity ^0.8.4; 5 | 6 | error NotCrossChainCall(); 7 | error InvalidCrossChainSender(address actual, address expected); 8 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC1820Registry.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1820Registry.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../utils/introspection/IERC1820Registry.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC721Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Metadata.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC721/extensions/IERC721Metadata.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165MissingData.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract ERC165MissingData { 6 | function supportsInterface(bytes4 interfaceId) public view {} // missing return 7 | } 8 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC2612.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2612.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC20/extensions/IERC20Permit.sol"; 7 | 8 | interface IERC2612 is IERC20Permit {} 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC20ExcessDecimalsMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract ERC20ExcessDecimalsMock { 6 | function decimals() public pure returns (uint256) { 7 | return type(uint256).max; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/crosschain/errors.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.6.0) (crosschain/errors.sol) 3 | 4 | pragma solidity ^0.8.4; 5 | 6 | error NotCrossChainCall(); 7 | error InvalidCrossChainSender(address actual, address expected); 8 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/metatx/README.adoc: -------------------------------------------------------------------------------- 1 | = Meta Transactions 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/metatx 5 | 6 | == Core 7 | 8 | {{ERC2771Context}} 9 | 10 | == Utils 11 | 12 | {{MinimalForwarder}} 13 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC1820Implementer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1820Implementer.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../utils/introspection/IERC1820Implementer.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC3156.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC3156.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "./IERC3156FlashBorrower.sol"; 7 | import "./IERC3156FlashLender.sol"; 8 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC721Enumerable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Enumerable.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC721/extensions/IERC721Enumerable.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/token/ERC20ExcessDecimalsMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract ERC20ExcessDecimalsMock { 6 | function decimals() public pure returns (uint256) { 7 | return type(uint256).max; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC1155MetadataURI.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155MetadataURI.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC1155/extensions/IERC1155MetadataURI.sol"; 7 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC2612.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/draft-IERC2612.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | // EIP-2612 is Final as of 2022-11-01. This file is deprecated. 7 | 8 | import "./IERC2612.sol"; 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC2612.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2612.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC20/extensions/IERC20Permit.sol"; 7 | 8 | interface IERC2612 is IERC20Permit {} 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/utils/cryptography/draft-EIP712.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | // EIP-712 is Final as of 2022-08-11. This file is deprecated. 7 | 8 | import "./EIP712.sol"; 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC2612.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/draft-IERC2612.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | // EIP-2612 is Final as of 2022-11-01. This file is deprecated. 7 | 8 | import "./IERC2612.sol"; 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC20MulticallMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/ERC20.sol"; 6 | import "../../utils/Multicall.sol"; 7 | 8 | abstract contract ERC20MulticallMock is ERC20, Multicall {} 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/proxy/BadBeacon.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract BadBeaconNoImpl {} 6 | 7 | contract BadBeaconNotContract { 8 | function implementation() external pure returns (address) { 9 | return address(0x1); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/security/RoleClient.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | import "./RoleClientBase.sol"; 4 | 5 | abstract contract RoleClient is RoleClientBase { 6 | 7 | constructor(address roleServer) RoleClientBase(roleServer) { 8 | _setupRoles(); 9 | } 10 | 11 | function _setupRoles() internal virtual; 12 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-role-server/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = "src" 3 | out = "out" 4 | libs = ["lib"] 5 | 6 | solc_version = "0.8.24" 7 | evm_version = "cancun" 8 | 9 | optimizer = true 10 | optimizer_runs = 1000000 11 | 12 | # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options 13 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC5805.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5805.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../governance/utils/IVotes.sol"; 7 | import "./IERC6372.sol"; 8 | 9 | interface IERC5805 is IERC6372, IVotes {} 10 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = "src" 3 | out = "out" 4 | libs = ["lib"] 5 | solc_version = "0.8.19" 6 | 7 | optimizer = true 8 | optimizer_runs = 1000000 9 | 10 | [fuzz] 11 | runs = 1000 12 | 13 | # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options 14 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/proxy/BadBeacon.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract BadBeaconNoImpl {} 6 | 7 | contract BadBeaconNotContract { 8 | function implementation() external pure returns (address) { 9 | return address(0x1); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/utils/cryptography/draft-EIP712.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | // EIP-712 is Final as of 2022-08-11. This file is deprecated. 7 | 8 | import "./EIP712.sol"; 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/crosschain/errors.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.6.0) (crosschain/errors.sol) 3 | 4 | pragma solidity ^0.8.4; 5 | 6 | error NotCrossChainCall(); 7 | error InvalidCrossChainSender(address actual, address expected); 8 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/metatx/README.adoc: -------------------------------------------------------------------------------- 1 | = Meta Transactions 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/metatx 5 | 6 | == Core 7 | 8 | {{ERC2771Context}} 9 | 10 | == Utils 11 | 12 | {{MinimalForwarder}} 13 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/access/OwnableBasic.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | import "./OwnablePermissions.sol"; 4 | import "./Ownable.sol"; 5 | 6 | abstract contract OwnableBasic is OwnablePermissions, Ownable { 7 | function _requireCallerIsContractOwner() internal view virtual override { 8 | _checkOwner(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC20ExcessDecimalsMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract ERC20ExcessDecimalsMock { 6 | function decimals() public pure returns (uint256) { 7 | return type(uint256).max; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/token/ICreatorTokenLegacy.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | interface ICreatorTokenLegacy { 4 | event TransferValidatorUpdated(address oldValidator, address newValidator); 5 | function getTransferValidator() external view returns (address validator); 6 | function setTransferValidator(address validator) external; 7 | } 8 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC5805.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5805.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../governance/utils/IVotes.sol"; 7 | import "./IERC6372.sol"; 8 | 9 | interface IERC5805 is IERC6372, IVotes {} 10 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = "src" 3 | out = "out" 4 | libs = ["lib"] 5 | 6 | solc_version = "0.8.24" 7 | evm_version = "cancun" 8 | 9 | optimizer = true 10 | optimizer_runs = 777 11 | 12 | # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options 13 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC2612.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2612.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC20/extensions/IERC20Permit.sol"; 7 | 8 | interface IERC2612 is IERC20Permit {} 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/draft-ERC20Permit.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/draft-ERC20Permit.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | // EIP-2612 is Final as of 2022-11-01. This file is deprecated. 7 | 8 | import "./ERC20Permit.sol"; 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/draft-IERC20Permit.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/draft-IERC20Permit.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | // EIP-2612 is Final as of 2022-11-01. This file is deprecated. 7 | 8 | import "./IERC20Permit.sol"; 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC2612.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/draft-IERC2612.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | // EIP-2612 is Final as of 2022-11-01. This file is deprecated. 7 | 8 | import "./IERC2612.sol"; 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/access/Ownable2StepBasic.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | import "./OwnablePermissions.sol"; 4 | import "./Ownable2Step.sol"; 5 | 6 | abstract contract Ownable2StepBasic is OwnablePermissions, Ownable2Step { 7 | function _requireCallerIsContractOwner() internal view virtual override { 8 | _checkOwner(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/draft-ERC20Permit.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/draft-ERC20Permit.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | // EIP-2612 is Final as of 2022-11-01. This file is deprecated. 7 | 8 | import "./ERC20Permit.sol"; 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/draft-IERC20Permit.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/draft-IERC20Permit.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | // EIP-2612 is Final as of 2022-11-01. This file is deprecated. 7 | 8 | import "./IERC20Permit.sol"; 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/utils/cryptography/draft-EIP712.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | // EIP-712 is Final as of 2022-08-11. This file is deprecated. 7 | 8 | import "./EIP712.sol"; 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/AccessControlCrossChainMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.4; 4 | 5 | import "../access/AccessControlCrossChain.sol"; 6 | import "../crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol"; 7 | 8 | contract AccessControlCrossChainMock is AccessControlCrossChain, CrossChainEnabledArbitrumL2 {} 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/proxy/BadBeacon.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract BadBeaconNoImpl {} 6 | 7 | contract BadBeaconNotContract { 8 | function implementation() external pure returns (address) { 9 | return address(0x1); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/src/DataTypes.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.24; 3 | 4 | struct CollectionSecurityPolicyV3 { 5 | bool disableAuthorizationMode; 6 | bool authorizersCannotSetWildcardOperators; 7 | uint8 transferSecurityLevel; 8 | uint120 listId; 9 | bool enableAccountFreezingMode; 10 | uint16 tokenType; 11 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/token/common/README.adoc: -------------------------------------------------------------------------------- 1 | = Common (Tokens) 2 | 3 | Functionality that is common to multiple token standards. 4 | 5 | * {ERC2981}: NFT Royalties compatible with both ERC721 and ERC1155. 6 | ** For ERC721 consider {ERC721Royalty} which clears the royalty information from storage on burn. 7 | 8 | == Contracts 9 | 10 | {{ERC2981}} 11 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/AccessControlCrossChainMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.4; 4 | 5 | import "../access/AccessControlCrossChain.sol"; 6 | import "../crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol"; 7 | 8 | contract AccessControlCrossChainMock is AccessControlCrossChain, CrossChainEnabledArbitrumL2 {} 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC5805.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5805.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../governance/utils/IVotes.sol"; 7 | import "./IERC6372.sol"; 8 | 9 | interface IERC5805 is IERC6372, IVotes {} 10 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/token/common/README.adoc: -------------------------------------------------------------------------------- 1 | = Common (Tokens) 2 | 3 | Functionality that is common to multiple token standards. 4 | 5 | * {ERC2981}: NFT Royalties compatible with both ERC721 and ERC1155. 6 | ** For ERC721 consider {ERC721Royalty} which clears the royalty information from storage on burn. 7 | 8 | == Contracts 9 | 10 | {{ERC2981}} 11 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/vendor/polygon/IFxMessageProcessor.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (vendor/polygon/IFxMessageProcessor.sol) 3 | pragma solidity ^0.8.0; 4 | 5 | interface IFxMessageProcessor { 6 | function processMessageFromRoot(uint256 stateId, address rootMessageSender, bytes calldata data) external; 7 | } 8 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/draft-ERC20Permit.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/draft-ERC20Permit.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | // EIP-2612 is Final as of 2022-11-01. This file is deprecated. 7 | 8 | import "./ERC20Permit.sol"; 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/draft-IERC20Permit.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/draft-IERC20Permit.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | // EIP-2612 is Final as of 2022-11-01. This file is deprecated. 7 | 8 | import "./IERC20Permit.sol"; 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/cryptography/DataTypes.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | /** 4 | * @dev The `v`, `r`, and `s` components of an ECDSA signature. For more information 5 | * [refer to this article](https://medium.com/mycrypto/the-magic-of-digital-signatures-on-ethereum-98fe184dc9c7). 6 | */ 7 | struct SignatureECDSA { 8 | uint256 v; 9 | bytes32 r; 10 | bytes32 s; 11 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/vendor/polygon/IFxMessageProcessor.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (vendor/polygon/IFxMessageProcessor.sol) 3 | pragma solidity ^0.8.0; 4 | 5 | interface IFxMessageProcessor { 6 | function processMessageFromRoot(uint256 stateId, address rootMessageSender, bytes calldata data) external; 7 | } 8 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/AccessControlCrossChainMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.4; 4 | 5 | import "../access/AccessControlCrossChain.sol"; 6 | import "../crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol"; 7 | 8 | contract AccessControlCrossChainMock is AccessControlCrossChain, CrossChainEnabledArbitrumL2 {} 9 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/token/common/README.adoc: -------------------------------------------------------------------------------- 1 | = Common (Tokens) 2 | 3 | Functionality that is common to multiple token standards. 4 | 5 | * {ERC2981}: NFT Royalties compatible with both ERC721 and ERC1155. 6 | ** For ERC721 consider {ERC721Royalty} which clears the royalty information from storage on burn. 7 | 8 | == Contracts 9 | 10 | {{ERC2981}} 11 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/vendor/polygon/IFxMessageProcessor.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (vendor/polygon/IFxMessageProcessor.sol) 3 | pragma solidity ^0.8.0; 4 | 5 | interface IFxMessageProcessor { 6 | function processMessageFromRoot(uint256 stateId, address rootMessageSender, bytes calldata data) external; 7 | } 8 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC777Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC777/ERC777.sol"; 6 | 7 | abstract contract ERC777Mock is ERC777 { 8 | event BeforeTokenTransfer(); 9 | 10 | function _beforeTokenTransfer(address, address, address, uint256) internal override { 11 | emit BeforeTokenTransfer(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ReentrancyAttack.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/Context.sol"; 6 | 7 | contract ReentrancyAttack is Context { 8 | function callSender(bytes4 data) public { 9 | (bool success, ) = _msgSender().call(abi.encodeWithSelector(data)); 10 | require(success, "ReentrancyAttack: failed call"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/draft-ERC721Votes.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/draft-ERC721Votes.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | // ERC721Votes was marked as draft due to the EIP-712 dependency. 7 | // EIP-712 is Final as of 2022-08-11. This file is deprecated. 8 | 9 | import "./ERC721Votes.sol"; 10 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165MaliciousData.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract ERC165MaliciousData { 6 | function supportsInterface(bytes4) public pure returns (bool) { 7 | assembly { 8 | mstore(0, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) 9 | return(0, 32) 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/token/ERC777Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC777/ERC777.sol"; 6 | 7 | abstract contract ERC777Mock is ERC777 { 8 | event BeforeTokenTransfer(); 9 | 10 | function _beforeTokenTransfer(address, address, address, uint256) internal override { 11 | emit BeforeTokenTransfer(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/ReentrancyAttack.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/Context.sol"; 6 | 7 | contract ReentrancyAttack is Context { 8 | function callSender(bytes4 data) public { 9 | (bool success, ) = _msgSender().call(abi.encodeWithSelector(data)); 10 | require(success, "ReentrancyAttack: failed call"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/draft-ERC721Votes.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/draft-ERC721Votes.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | // ERC721Votes was marked as draft due to the EIP-712 dependency. 7 | // EIP-712 is Final as of 2022-08-11. This file is deprecated. 8 | 9 | import "./ERC721Votes.sol"; 10 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165MaliciousData.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract ERC165MaliciousData { 6 | function supportsInterface(bytes4) public pure returns (bool) { 7 | assembly { 8 | mstore(0, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) 9 | return(0, 32) 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/token/ICreatorToken.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | interface ICreatorToken { 4 | event TransferValidatorUpdated(address oldValidator, address newValidator); 5 | function getTransferValidator() external view returns (address validator); 6 | function setTransferValidator(address validator) external; 7 | function getTransferValidationFunction() external view returns (bytes4 functionSignature, bool isViewFunction); 8 | } -------------------------------------------------------------------------------- /lib/forge-std/test/compilation/CompilationTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | pragma experimental ABIEncoderV2; 5 | 6 | import "../../src/Test.sol"; 7 | 8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing 9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 10 | contract CompilationTest is Test {} 11 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/Errors.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | // General Purpose Custom Errors 4 | error Error__BadConstructorArgument(); 5 | 6 | // Authorization Errors 7 | error RoleClient__Unauthorized(); 8 | 9 | // Extensible Custom Errors 10 | error Extensible__ConflictingFunctionSelectorAlreadyInstalled(); 11 | error Extensible__ExtensionAlreadyInstalled(); 12 | error Extensible__ExtensionNotInstalled(); 13 | error Extensible__InvalidExtension(); -------------------------------------------------------------------------------- /test/helpers/Random.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.24; 3 | 4 | contract Random { 5 | bytes32 private _lastHash; 6 | 7 | constructor(uint256 seed) { 8 | _lastHash = keccak256(abi.encodePacked(seed)); 9 | } 10 | 11 | function getNext(uint256 min, uint256 max) public returns (uint256) { 12 | _lastHash = keccak256(abi.encodePacked(_lastHash)); 13 | return min + uint256(_lastHash) % (max - min); 14 | } 15 | } -------------------------------------------------------------------------------- /lib/forge-std/test/compilation/CompilationScript.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | pragma experimental ABIEncoderV2; 5 | 6 | import "../../src/Script.sol"; 7 | 8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing 9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 10 | contract CompilationScript is Script {} 11 | -------------------------------------------------------------------------------- /lib/forge-std/test/compilation/CompilationTestBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | pragma experimental ABIEncoderV2; 5 | 6 | import "../../src/Test.sol"; 7 | 8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing 9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 10 | contract CompilationTestBase is TestBase {} 11 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/EtherReceiverMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract EtherReceiverMock { 6 | bool private _acceptEther; 7 | 8 | function setAcceptEther(bool acceptEther) public { 9 | _acceptEther = acceptEther; 10 | } 11 | 12 | receive() external payable { 13 | if (!_acceptEther) { 14 | revert(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC777Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC777/ERC777.sol"; 6 | 7 | abstract contract ERC777Mock is ERC777 { 8 | event BeforeTokenTransfer(); 9 | 10 | function _beforeTokenTransfer(address, address, address, uint256) internal override { 11 | emit BeforeTokenTransfer(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/draft-ERC721Votes.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/draft-ERC721Votes.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | // ERC721Votes was marked as draft due to the EIP-712 dependency. 7 | // EIP-712 is Final as of 2022-08-11. This file is deprecated. 8 | 9 | import "./ERC721Votes.sol"; 10 | -------------------------------------------------------------------------------- /lib/forge-std/test/compilation/CompilationScriptBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | pragma experimental ABIEncoderV2; 5 | 6 | import "../../src/Script.sol"; 7 | 8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing 9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 10 | contract CompilationScriptBase is ScriptBase {} 11 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/EtherReceiverMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract EtherReceiverMock { 6 | bool private _acceptEther; 7 | 8 | function setAcceptEther(bool acceptEther) public { 9 | _acceptEther = acceptEther; 10 | } 11 | 12 | receive() external payable { 13 | if (!_acceptEther) { 14 | revert(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165MaliciousData.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract ERC165MaliciousData { 6 | function supportsInterface(bytes4) public pure returns (bool) { 7 | assembly { 8 | mstore(0, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) 9 | return(0, 32) 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ReentrancyAttack.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/Context.sol"; 6 | 7 | contract ReentrancyAttack is Context { 8 | function callSender(bytes4 data) public { 9 | (bool success, ) = _msgSender().call(abi.encodeWithSelector(data)); 10 | require(success, "ReentrancyAttack: failed call"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/token/Constants.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | /// @dev Constant value representing the ERC721 token type for signatures and transfer hooks 4 | uint256 constant TOKEN_TYPE_ERC721 = 721; 5 | /// @dev Constant value representing the ERC1155 token type for signatures and transfer hooks 6 | uint256 constant TOKEN_TYPE_ERC1155 = 1155; 7 | /// @dev Constant value representing the ERC20 token type for signatures and transfer hooks 8 | uint256 constant TOKEN_TYPE_ERC20 = 20; -------------------------------------------------------------------------------- /lib/tm-tokenmaster/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = "src" 3 | out = "out" 4 | libs = ["lib"] 5 | 6 | solc_version = "0.8.24" 7 | evm_version = "cancun" 8 | 9 | optimizer = true 10 | optimizer_runs = 999_999_999 11 | 12 | # Ignore - SPDX, Transient, Init Code Size, Selfdestruct, Deployed Code Size 13 | ignored_error_codes = [1878, 2394, 3860, 5159, 5574] 14 | 15 | [fuzz] 16 | runs = 200 17 | max_test_rejects = 2560000 18 | 19 | [invariant] 20 | runs = 200 21 | depth = 500 22 | fail_on_revert = false -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/PullPaymentMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../security/PullPayment.sol"; 6 | 7 | // mock class using PullPayment 8 | contract PullPaymentMock is PullPayment { 9 | constructor() payable {} 10 | 11 | // test helper function to call asyncTransfer 12 | function callTransfer(address dest, uint256 amount) public { 13 | _asyncTransfer(dest, amount); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/EtherReceiverMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract EtherReceiverMock { 6 | bool private _acceptEther; 7 | 8 | function setAcceptEther(bool acceptEther) public { 9 | _acceptEther = acceptEther; 10 | } 11 | 12 | receive() external payable { 13 | if (!_acceptEther) { 14 | revert(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC20DecimalsMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/ERC20.sol"; 6 | 7 | abstract contract ERC20DecimalsMock is ERC20 { 8 | uint8 private immutable _decimals; 9 | 10 | constructor(uint8 decimals_) { 11 | _decimals = decimals_; 12 | } 13 | 14 | function decimals() public view override returns (uint8) { 15 | return _decimals; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/PullPaymentMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../security/PullPayment.sol"; 6 | 7 | // mock class using PullPayment 8 | contract PullPaymentMock is PullPayment { 9 | constructor() payable {} 10 | 11 | // test helper function to call asyncTransfer 12 | function callTransfer(address dest, uint256 amount) public { 13 | _asyncTransfer(dest, amount); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/token/ERC20DecimalsMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/ERC20.sol"; 6 | 7 | abstract contract ERC20DecimalsMock is ERC20 { 8 | uint8 private immutable _decimals; 9 | 10 | constructor(uint8 decimals_) { 11 | _decimals = decimals_; 12 | } 13 | 14 | function decimals() public view override returns (uint8) { 15 | return _decimals; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = "src" 3 | out = "out" 4 | libs = ["lib"] 5 | 6 | solc_version = "0.8.24" 7 | evm_version = "cancun" 8 | 9 | optimizer = true 10 | optimizer_runs = 999_999_999 11 | gas_limit = "18446744073709551615" # u64::MAX 12 | 13 | # Ignore - SPDX, Transient, Init Code Size, Selfdestruct, Deployed Code Size 14 | ignored_error_codes = [1878, 2394, 3860, 5159, 5574] 15 | 16 | [fuzz] 17 | runs = 200 18 | max_test_rejects = 2560000 19 | 20 | [invariant] 21 | runs = 200 22 | depth = 500 23 | fail_on_revert = false -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ERC20Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {ERC20} from "../token/ERC20/ERC20.sol"; 5 | 6 | contract ERC20Mock is ERC20 { 7 | constructor() ERC20("ERC20Mock", "E20M") {} 8 | 9 | function mint(address account, uint256 amount) external { 10 | _mint(account, amount); 11 | } 12 | 13 | function burn(address account, uint256 amount) external { 14 | _burn(account, amount); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC4626OffsetMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/extensions/ERC4626.sol"; 6 | 7 | abstract contract ERC4626OffsetMock is ERC4626 { 8 | uint8 private immutable _offset; 9 | 10 | constructor(uint8 offset_) { 11 | _offset = offset_; 12 | } 13 | 14 | function _decimalsOffset() internal view virtual override returns (uint8) { 15 | return _offset; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/ERC20Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {ERC20} from "../token/ERC20/ERC20.sol"; 5 | 6 | contract ERC20Mock is ERC20 { 7 | constructor() ERC20("ERC20Mock", "E20M") {} 8 | 9 | function mint(address account, uint256 amount) external { 10 | _mint(account, amount); 11 | } 12 | 13 | function burn(address account, uint256 amount) external { 14 | _burn(account, amount); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/PullPaymentMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../security/PullPayment.sol"; 6 | 7 | // mock class using PullPayment 8 | contract PullPaymentMock is PullPayment { 9 | constructor() payable {} 10 | 11 | // test helper function to call asyncTransfer 12 | function callTransfer(address dest, uint256 amount) public { 13 | _asyncTransfer(dest, amount); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/token/ERC4626OffsetMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/extensions/ERC4626.sol"; 6 | 7 | abstract contract ERC4626OffsetMock is ERC4626 { 8 | uint8 private immutable _offset; 9 | 10 | constructor(uint8 offset_) { 11 | _offset = offset_; 12 | } 13 | 14 | function _decimalsOffset() internal view virtual override returns (uint8) { 15 | return _offset; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC20DecimalsMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/ERC20.sol"; 6 | 7 | abstract contract ERC20DecimalsMock is ERC20 { 8 | uint8 private immutable _decimals; 9 | 10 | constructor(uint8 decimals_) { 11 | _decimals = decimals_; 12 | } 13 | 14 | function decimals() public view override returns (uint8) { 15 | return _decimals; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/token/common/IExtensionERC2981.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | interface IExtensionERC2981 { 4 | /** 5 | * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of 6 | * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. 7 | */ 8 | function extensionRoyaltyInfo( 9 | uint256 tokenId, 10 | uint256 salePrice 11 | ) external view returns (address receiver, uint256 royaltyAmount); 12 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ERC20Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {ERC20} from "../token/ERC20/ERC20.sol"; 5 | 6 | contract ERC20Mock is ERC20 { 7 | constructor() ERC20("ERC20Mock", "E20M") {} 8 | 9 | function mint(address account, uint256 amount) external { 10 | _mint(account, amount); 11 | } 12 | 13 | function burn(address account, uint256 amount) external { 14 | _burn(account, amount); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC4626OffsetMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/extensions/ERC4626.sol"; 6 | 7 | abstract contract ERC4626OffsetMock is ERC4626 { 8 | uint8 private immutable _offset; 9 | 10 | constructor(uint8 offset_) { 11 | _offset = offset_; 12 | } 13 | 14 | function _decimalsOffset() internal view virtual override returns (uint8) { 15 | return _offset; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/token/erc1155/StorageERC1155.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | library StorageERC1155 { 4 | bytes32 private constant DATA_STORAGE_SLOT = keccak256("storage.ERC1155"); 5 | 6 | struct Data { 7 | string uri; 8 | mapping(bytes32 => uint256) balances; 9 | mapping(bytes32 => bool) operatorApprovals; 10 | } 11 | 12 | function data() internal pure returns (Data storage ptr) { 13 | bytes32 slot = DATA_STORAGE_SLOT; 14 | assembly { 15 | ptr.slot := slot 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ERC4626Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import "../token/ERC20/extensions/ERC4626.sol"; 5 | 6 | contract ERC4626Mock is ERC4626 { 7 | constructor(address underlying) ERC20("ERC4626Mock", "E4626M") ERC4626(IERC20(underlying)) {} 8 | 9 | function mint(address account, uint256 amount) external { 10 | _mint(account, amount); 11 | } 12 | 13 | function burn(address account, uint256 amount) external { 14 | _burn(account, amount); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/src/interfaces/IMinterBurnerRolePool.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: LicenseRef-PolyForm-Strict-1.0.0 2 | pragma solidity 0.8.24; 3 | 4 | /** 5 | * @title IMinterBurnerRolePool 6 | * @author Limit Break, Inc. 7 | * @notice Interface definition for pools that implement external minting and burning functions. 8 | */ 9 | interface IMinterBurnerRolePool { 10 | function mint(address to, uint256 amount) external; 11 | function mintBatch(address[] calldata toAddresses, uint256[] calldata amounts) external; 12 | function burn(address from, uint256 amount) external; 13 | } -------------------------------------------------------------------------------- /lib/forge-std/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "forge-std", 3 | "version": "1.9.5", 4 | "description": "Forge Standard Library is a collection of helpful contracts and libraries for use with Forge and Foundry.", 5 | "homepage": "https://book.getfoundry.sh/forge/forge-std", 6 | "bugs": "https://github.com/foundry-rs/forge-std/issues", 7 | "license": "(Apache-2.0 OR MIT)", 8 | "author": "Contributors to Forge Standard Library", 9 | "files": [ 10 | "src/**/*" 11 | ], 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/foundry-rs/forge-std.git" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev This is the interface that {BeaconProxy} expects of its beacon. 8 | */ 9 | interface IBeacon { 10 | /** 11 | * @dev Must return an address that can be used as a delegate call target. 12 | * 13 | * {BeaconProxy} will check that this address is a contract. 14 | */ 15 | function implementation() external view returns (address); 16 | } 17 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/ERC4626Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import "../token/ERC20/extensions/ERC4626.sol"; 5 | 6 | contract ERC4626Mock is ERC4626 { 7 | constructor(address underlying) ERC20("ERC4626Mock", "E4626M") ERC4626(IERC20(underlying)) {} 8 | 9 | function mint(address account, uint256 amount) external { 10 | _mint(account, amount); 11 | } 12 | 13 | function burn(address account, uint256 amount) external { 14 | _burn(account, amount); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165ReturnBomb.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../utils/introspection/IERC165.sol"; 6 | 7 | contract ERC165ReturnBombMock is IERC165 { 8 | function supportsInterface(bytes4 interfaceId) public pure override returns (bool) { 9 | if (interfaceId == type(IERC165).interfaceId) { 10 | assembly { 11 | mstore(0, 1) 12 | } 13 | } 14 | assembly { 15 | return(0, 101500) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/src/DataTypes.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | /// @dev Storage data struct for stored approvals and order approvals 5 | struct PackedApproval { 6 | // Only used for partial fill position 1155 transfers 7 | uint8 state; 8 | // Amount allowed 9 | uint200 amount; 10 | // Permission expiry 11 | uint48 expiration; 12 | } 13 | 14 | /// @dev Calldata data struct for order fill amounts 15 | struct OrderFillAmounts { 16 | uint256 orderStartAmount; 17 | uint256 requestedFillAmount; 18 | uint256 minimumFillAmount; 19 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev This is the interface that {BeaconProxy} expects of its beacon. 8 | */ 9 | interface IBeacon { 10 | /** 11 | * @dev Must return an address that can be used as a delegate call target. 12 | * 13 | * {BeaconProxy} will check that this address is a contract. 14 | */ 15 | function implementation() external view returns (address); 16 | } 17 | -------------------------------------------------------------------------------- /lib/forge-std/src/interfaces/IERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2; 3 | 4 | interface IERC165 { 5 | /// @notice Query if a contract implements an interface 6 | /// @param interfaceID The interface identifier, as specified in ERC-165 7 | /// @dev Interface identification is specified in ERC-165. This function 8 | /// uses less than 30,000 gas. 9 | /// @return `true` if the contract implements `interfaceID` and 10 | /// `interfaceID` is not 0xffffffff, `false` otherwise 11 | function supportsInterface(bytes4 interfaceID) external view returns (bool); 12 | } 13 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC721URIStorageMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC721/extensions/ERC721URIStorage.sol"; 6 | 7 | abstract contract ERC721URIStorageMock is ERC721URIStorage { 8 | string private _baseTokenURI; 9 | 10 | function _baseURI() internal view virtual override returns (string memory) { 11 | return _baseTokenURI; 12 | } 13 | 14 | function setBaseURI(string calldata newBaseTokenURI) public { 15 | _baseTokenURI = newBaseTokenURI; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165ReturnBomb.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../utils/introspection/IERC165.sol"; 6 | 7 | contract ERC165ReturnBombMock is IERC165 { 8 | function supportsInterface(bytes4 interfaceId) public pure override returns (bool) { 9 | if (interfaceId == type(IERC165).interfaceId) { 10 | assembly { 11 | mstore(0, 1) 12 | } 13 | } 14 | assembly { 15 | return(0, 101500) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/security/RoleSetClient.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | import "./RoleClientBase.sol"; 4 | 5 | abstract contract RoleSetClient is RoleClientBase { 6 | 7 | constructor(address roleServer, bytes32 roleSet) RoleClientBase(roleServer) { 8 | _setupRoles(roleSet); 9 | } 10 | 11 | function _hashRoleSetRole( 12 | bytes32 roleSet, 13 | bytes32 baseRole 14 | ) internal pure returns (bytes32 role) { 15 | role = keccak256(abi.encode(roleSet, baseRole)); 16 | } 17 | 18 | function _setupRoles(bytes32 roleSet) internal virtual; 19 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC5313.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5313.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface for the Light Contract Ownership Standard. 8 | * 9 | * A standardized minimal interface required to identify an account that controls a contract 10 | * 11 | * _Available since v4.9._ 12 | */ 13 | interface IERC5313 { 14 | /** 15 | * @dev Gets the address of the owner. 16 | */ 17 | function owner() external view returns (address); 18 | } 19 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/token/ERC721URIStorageMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC721/extensions/ERC721URIStorage.sol"; 6 | 7 | abstract contract ERC721URIStorageMock is ERC721URIStorage { 8 | string private _baseTokenURI; 9 | 10 | function _baseURI() internal view virtual override returns (string memory) { 11 | return _baseTokenURI; 12 | } 13 | 14 | function setBaseURI(string calldata newBaseTokenURI) public { 15 | _baseTokenURI = newBaseTokenURI; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ERC4626Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import "../token/ERC20/extensions/ERC4626.sol"; 5 | 6 | contract ERC4626Mock is ERC4626 { 7 | constructor(address underlying) ERC20("ERC4626Mock", "E4626M") ERC4626(IERC20(underlying)) {} 8 | 9 | function mint(address account, uint256 amount) external { 10 | _mint(account, amount); 11 | } 12 | 13 | function burn(address account, uint256 amount) external { 14 | _burn(account, amount); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC20ForceApproveMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/ERC20.sol"; 6 | 7 | // contract that replicate USDT (0xdac17f958d2ee523a2206206994597c13d831ec7) approval beavior 8 | abstract contract ERC20ForceApproveMock is ERC20 { 9 | function approve(address spender, uint256 amount) public virtual override returns (bool) { 10 | require(amount == 0 || allowance(msg.sender, spender) == 0, "USDT approval failure"); 11 | return super.approve(spender, amount); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC5313.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5313.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface for the Light Contract Ownership Standard. 8 | * 9 | * A standardized minimal interface required to identify an account that controls a contract 10 | * 11 | * _Available since v4.9._ 12 | */ 13 | interface IERC5313 { 14 | /** 15 | * @dev Gets the address of the owner. 16 | */ 17 | function owner() external view returns (address); 18 | } 19 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev This is the interface that {BeaconProxy} expects of its beacon. 8 | */ 9 | interface IBeacon { 10 | /** 11 | * @dev Must return an address that can be used as a delegate call target. 12 | * 13 | * {BeaconProxy} will check that this address is a contract. 14 | */ 15 | function implementation() external view returns (address); 16 | } 17 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/src/interfaces/ITokenMasterBuyHook.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: LicenseRef-PolyForm-Strict-1.0.0 2 | pragma solidity 0.8.24; 3 | 4 | /** 5 | * @title ITokenMasterBuyHook 6 | * @author Limit Break, Inc. 7 | * @notice Interface that must be implemented by contracts acting as a buy hook 8 | * @notice for advanced buy orders. 9 | */ 10 | interface ITokenMasterBuyHook { 11 | function tokenMasterBuyHook( 12 | address tokenMasterToken, 13 | address buyer, 14 | bytes32 creatorBuyIdentifier, 15 | uint256 amountPurchased, 16 | bytes calldata hookExtraData 17 | ) external; 18 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/src/interfaces/ITokenMasterSellHook.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: LicenseRef-PolyForm-Strict-1.0.0 2 | pragma solidity 0.8.24; 3 | 4 | /** 5 | * @title ITokenMasterSellHook 6 | * @author Limit Break, Inc. 7 | * @notice Interface that must be implemented by contracts acting as a sell hook 8 | * @notice for advanced sell orders. 9 | */ 10 | interface ITokenMasterSellHook { 11 | function tokenMasterSellHook( 12 | address tokenMasterToken, 13 | address seller, 14 | bytes32 creatorSellIdentifier, 15 | uint256 amountSold, 16 | bytes calldata hookExtraData 17 | ) external; 18 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/src/interfaces/ITokenMasterSpendHook.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: LicenseRef-PolyForm-Strict-1.0.0 2 | pragma solidity 0.8.24; 3 | 4 | /** 5 | * @title ITokenMasterSpendHook 6 | * @author Limit Break, Inc. 7 | * @notice Interface that must be implemented by contracts acting as a spend hook 8 | * @notice for spend orders. 9 | */ 10 | interface ITokenMasterSpendHook { 11 | function tokenMasterSpendHook( 12 | address tokenMasterToken, 13 | address spender, 14 | bytes32 creatorSpendIdentifier, 15 | uint256 multiplier, 16 | bytes calldata hookExtraData 17 | ) external; 18 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ConditionalEscrowMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/escrow/ConditionalEscrow.sol"; 6 | 7 | // mock class using ConditionalEscrow 8 | contract ConditionalEscrowMock is ConditionalEscrow { 9 | mapping(address => bool) private _allowed; 10 | 11 | function setAllowed(address payee, bool allowed) public { 12 | _allowed[payee] = allowed; 13 | } 14 | 15 | function withdrawalAllowed(address payee) public view override returns (bool) { 16 | return _allowed[payee]; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/token/ERC20ForceApproveMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/ERC20.sol"; 6 | 7 | // contract that replicate USDT (0xdac17f958d2ee523a2206206994597c13d831ec7) approval beavior 8 | abstract contract ERC20ForceApproveMock is ERC20 { 9 | function approve(address spender, uint256 amount) public virtual override returns (bool) { 10 | require(amount == 0 || allowance(msg.sender, spender) == 0, "USDT approval failure"); 11 | return super.approve(spender, amount); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165ReturnBomb.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../utils/introspection/IERC165.sol"; 6 | 7 | contract ERC165ReturnBombMock is IERC165 { 8 | function supportsInterface(bytes4 interfaceId) public pure override returns (bool) { 9 | if (interfaceId == type(IERC165).interfaceId) { 10 | assembly { 11 | mstore(0, 1) 12 | } 13 | } 14 | assembly { 15 | return(0, 101500) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/src/DataTypes.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | /// @dev Storage data struct for stored approvals and order approvals 5 | struct PackedApproval { 6 | // Only used for partial fill position 1155 transfers 7 | uint8 state; 8 | // Amount allowed 9 | uint200 amount; 10 | // Permission expiry 11 | uint48 expiration; 12 | } 13 | 14 | /// @dev Calldata data struct for order fill amounts 15 | struct OrderFillAmounts { 16 | uint256 orderStartAmount; 17 | uint256 requestedFillAmount; 18 | uint256 minimumFillAmount; 19 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/ConditionalEscrowMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/escrow/ConditionalEscrow.sol"; 6 | 7 | // mock class using ConditionalEscrow 8 | contract ConditionalEscrowMock is ConditionalEscrow { 9 | mapping(address => bool) private _allowed; 10 | 11 | function setAllowed(address payee, bool allowed) public { 12 | _allowed[payee] = allowed; 13 | } 14 | 15 | function withdrawalAllowed(address payee) public view override returns (bool) { 16 | return _allowed[payee]; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC721URIStorageMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC721/extensions/ERC721URIStorage.sol"; 6 | 7 | abstract contract ERC721URIStorageMock is ERC721URIStorage { 8 | string private _baseTokenURI; 9 | 10 | function _baseURI() internal view virtual override returns (string memory) { 11 | return _baseTokenURI; 12 | } 13 | 14 | function setBaseURI(string calldata newBaseTokenURI) public { 15 | _baseTokenURI = newBaseTokenURI; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC20ReturnFalseMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/ERC20.sol"; 6 | 7 | abstract contract ERC20ReturnFalseMock is ERC20 { 8 | function transfer(address, uint256) public pure override returns (bool) { 9 | return false; 10 | } 11 | 12 | function transferFrom(address, address, uint256) public pure override returns (bool) { 13 | return false; 14 | } 15 | 16 | function approve(address, uint256) public pure override returns (bool) { 17 | return false; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC5313.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5313.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface for the Light Contract Ownership Standard. 8 | * 9 | * A standardized minimal interface required to identify an account that controls a contract 10 | * 11 | * _Available since v4.9._ 12 | */ 13 | interface IERC5313 { 14 | /** 15 | * @dev Gets the address of the owner. 16 | */ 17 | function owner() external view returns (address); 18 | } 19 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/token/erc1155/IERC1155MetadataURI.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | import "./IERC1155.sol"; 4 | 5 | /** 6 | * @dev Interface of the optional ERC1155MetadataExtension interface, as defined 7 | * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. 8 | */ 9 | interface IERC1155MetadataURI is IERC1155 { 10 | /** 11 | * @dev Returns the URI for token type `id`. 12 | * 13 | * If the `\{id\}` substring is present in the URI, it must be replaced by 14 | * clients with the actual token type ID. 15 | */ 16 | function uri(uint256 id) external view returns (string memory); 17 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/proxy/ClashingImplementation.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | /** 6 | * @dev Implementation contract with a payable admin() function made to clash with TransparentUpgradeableProxy's to 7 | * test correct functioning of the Transparent Proxy feature. 8 | */ 9 | contract ClashingImplementation { 10 | function admin() external payable returns (address) { 11 | return 0x0000000000000000000000000000000011111142; 12 | } 13 | 14 | function delegatedFunction() external pure returns (bool) { 15 | return true; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/token/ERC20ReturnFalseMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/ERC20.sol"; 6 | 7 | abstract contract ERC20ReturnFalseMock is ERC20 { 8 | function transfer(address, uint256) public pure override returns (bool) { 9 | return false; 10 | } 11 | 12 | function transferFrom(address, address, uint256) public pure override returns (bool) { 13 | return false; 14 | } 15 | 16 | function approve(address, uint256) public pure override returns (bool) { 17 | return false; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC6372.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC6372.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | interface IERC6372 { 7 | /** 8 | * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting). 9 | */ 10 | function clock() external view returns (uint48); 11 | 12 | /** 13 | * @dev Description of the clock 14 | */ 15 | // solhint-disable-next-line func-name-mixedcase 16 | function CLOCK_MODE() external view returns (string memory); 17 | } 18 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/proxy/ClashingImplementation.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | /** 6 | * @dev Implementation contract with a payable admin() function made to clash with TransparentUpgradeableProxy's to 7 | * test correct functioning of the Transparent Proxy feature. 8 | */ 9 | contract ClashingImplementation { 10 | function admin() external payable returns (address) { 11 | return 0x0000000000000000000000000000000011111142; 12 | } 13 | 14 | function delegatedFunction() external pure returns (bool) { 15 | return true; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC20ForceApproveMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/ERC20.sol"; 6 | 7 | // contract that replicate USDT (0xdac17f958d2ee523a2206206994597c13d831ec7) approval beavior 8 | abstract contract ERC20ForceApproveMock is ERC20 { 9 | function approve(address spender, uint256 amount) public virtual override returns (bool) { 10 | require(amount == 0 || allowance(msg.sender, spender) == 0, "USDT approval failure"); 11 | return super.approve(spender, amount); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ConditionalEscrowMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/escrow/ConditionalEscrow.sol"; 6 | 7 | // mock class using ConditionalEscrow 8 | contract ConditionalEscrowMock is ConditionalEscrow { 9 | mapping(address => bool) private _allowed; 10 | 11 | function setAllowed(address payee, bool allowed) public { 12 | _allowed[payee] = allowed; 13 | } 14 | 15 | function withdrawalAllowed(address payee) public view override returns (bool) { 16 | return _allowed[payee]; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/src/interfaces/ITokenMasterOracle.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: LicenseRef-PolyForm-Strict-1.0.0 2 | pragma solidity 0.8.24; 3 | 4 | /** 5 | * @title ITokenMasterOracle 6 | * @author Limit Break, Inc. 7 | * @notice Interface that must be implemented by contracts acting as an oracle 8 | * @notice for advanced orders. 9 | */ 10 | interface ITokenMasterOracle { 11 | function adjustValue( 12 | uint256 transactionType, 13 | address executor, 14 | address tokenMasterToken, 15 | address baseToken, 16 | uint256 baseValue, 17 | bytes calldata oracleExtraData 18 | ) external view returns(uint256 tokenValue); 19 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC6372.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC6372.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | interface IERC6372 { 7 | /** 8 | * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting). 9 | */ 10 | function clock() external view returns (uint48); 11 | 12 | /** 13 | * @dev Description of the clock 14 | */ 15 | // solhint-disable-next-line func-name-mixedcase 16 | function CLOCK_MODE() external view returns (string memory); 17 | } 18 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/src/pools/promotional-pool/IPromotionalPool.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: LicenseRef-PolyForm-Strict-1.0.0 2 | pragma solidity 0.8.24; 3 | 4 | import "./DataTypes.sol"; 5 | import "../../interfaces/ITokenMasterERC20C.sol"; 6 | 7 | /** 8 | * @title IPromotionalPool 9 | * @author Limit Break, Inc. 10 | * @notice Interface definition for a PromotionalPool contract. 11 | */ 12 | interface IPromotionalPool is ITokenMasterERC20C { 13 | event BuyParametersUpdated(); 14 | 15 | function setBuyParameters(PromotionalPoolBuyParameters calldata _buyParameters) external; 16 | function getBuyParameters() external view returns(PromotionalPoolBuyParameters memory); 17 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC20ReturnFalseMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/ERC20.sol"; 6 | 7 | abstract contract ERC20ReturnFalseMock is ERC20 { 8 | function transfer(address, uint256) public pure override returns (bool) { 9 | return false; 10 | } 11 | 12 | function transferFrom(address, address, uint256) public pure override returns (bool) { 13 | return false; 14 | } 15 | 16 | function approve(address, uint256) public pure override returns (bool) { 17 | return false; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/proxy/ClashingImplementation.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | /** 6 | * @dev Implementation contract with a payable admin() function made to clash with TransparentUpgradeableProxy's to 7 | * test correct functioning of the Transparent Proxy feature. 8 | */ 9 | contract ClashingImplementation { 10 | function admin() external payable returns (address) { 11 | return 0x0000000000000000000000000000000011111142; 12 | } 13 | 14 | function delegatedFunction() external pure returns (bool) { 15 | return true; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC6372.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC6372.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | interface IERC6372 { 7 | /** 8 | * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting). 9 | */ 10 | function clock() external view returns (uint48); 11 | 12 | /** 13 | * @dev Description of the clock 14 | */ 15 | // solhint-disable-next-line func-name-mixedcase 16 | function CLOCK_MODE() external view returns (string memory); 17 | } 18 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/token/erc721/StorageERC721.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | library StorageERC721 { 4 | bytes32 private constant DATA_STORAGE_SLOT = keccak256("storage.ERC721"); 5 | 6 | struct Data { 7 | string name; 8 | string symbol; 9 | 10 | mapping(uint256 => address) owners; 11 | mapping(address => uint256) balances; 12 | mapping(uint256 => address) tokenApprovals; 13 | mapping(bytes32 => bool) operatorApprovals; 14 | } 15 | 16 | function data() internal pure returns (Data storage ptr) { 17 | bytes32 slot = DATA_STORAGE_SLOT; 18 | assembly { 19 | ptr.slot := slot 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorVoteMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../governance/extensions/GovernorCountingSimple.sol"; 6 | import "../../governance/extensions/GovernorVotes.sol"; 7 | 8 | abstract contract GovernorVoteMocks is GovernorVotes, GovernorCountingSimple { 9 | function quorum(uint256) public pure override returns (uint256) { 10 | return 0; 11 | } 12 | 13 | function votingDelay() public pure override returns (uint256) { 14 | return 4; 15 | } 16 | 17 | function votingPeriod() public pure override returns (uint256) { 18 | return 16; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/misc/StorageTstorish.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.24; 2 | 3 | library StorageTstorish { 4 | // keccak256(abi.encode(uint256(keccak256("storage.Tstorish")) - 1)) & ~bytes32(uint256(0xff)) 5 | bytes32 private constant DATA_STORAGE_SLOT = 6 | 0xdacd49f6a6c42b45a5c3d195b83b324104542d9147bb8064a39c6a8d23ba9b00; 7 | 8 | struct Data { 9 | // Indicates if TSTORE support has been activated during or post-deployment. 10 | bool tstoreSupport; 11 | } 12 | 13 | function data() internal pure returns (Data storage ptr) { 14 | bytes32 slot = DATA_STORAGE_SLOT; 15 | assembly { 16 | ptr.slot := slot 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC2309.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.8.0) (interfaces/IERC2309.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev ERC-2309: ERC-721 Consecutive Transfer Extension. 8 | * 9 | * _Available since v4.8._ 10 | */ 11 | interface IERC2309 { 12 | /** 13 | * @dev Emitted when the tokens from `fromTokenId` to `toTokenId` are transferred from `fromAddress` to `toAddress`. 14 | */ 15 | event ConsecutiveTransfer( 16 | uint256 indexed fromTokenId, 17 | uint256 toTokenId, 18 | address indexed fromAddress, 19 | address indexed toAddress 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorCompMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../governance/extensions/GovernorCountingSimple.sol"; 6 | import "../../governance/extensions/GovernorVotesComp.sol"; 7 | 8 | abstract contract GovernorCompMock is GovernorVotesComp, GovernorCountingSimple { 9 | function quorum(uint256) public pure override returns (uint256) { 10 | return 0; 11 | } 12 | 13 | function votingDelay() public pure override returns (uint256) { 14 | return 4; 15 | } 16 | 17 | function votingPeriod() public pure override returns (uint256) { 18 | return 16; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorVoteMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../governance/extensions/GovernorCountingSimple.sol"; 6 | import "../../governance/extensions/GovernorVotes.sol"; 7 | 8 | abstract contract GovernorVoteMocks is GovernorVotes, GovernorCountingSimple { 9 | function quorum(uint256) public pure override returns (uint256) { 10 | return 0; 11 | } 12 | 13 | function votingDelay() public pure override returns (uint256) { 14 | return 4; 15 | } 16 | 17 | function votingPeriod() public pure override returns (uint256) { 18 | return 16; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/src/pools/stable-pool/StablePoolCreationCode.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: LicenseRef-PolyForm-Strict-1.0.0 2 | pragma solidity 0.8.24; 3 | 4 | import "./StablePool.sol"; 5 | import "@limitbreak/tm-core-lib/src/licenses/LicenseRef-PolyForm-Strict-1.0.0.sol"; 6 | 7 | /** 8 | * @title StablePoolCreationCode 9 | * @author Limit Break, Inc. 10 | * @notice Stores the init code for a TokenMaster Stable Pool to use in factory deployments. 11 | */ 12 | contract StablePoolCreationCode { 13 | 14 | constructor() { 15 | bytes memory creationCode = type(StablePool).creationCode; 16 | assembly ("memory-safe") { 17 | return(add(0x20, creationCode), mload(creationCode)) 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC2309.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.8.0) (interfaces/IERC2309.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev ERC-2309: ERC-721 Consecutive Transfer Extension. 8 | * 9 | * _Available since v4.8._ 10 | */ 11 | interface IERC2309 { 12 | /** 13 | * @dev Emitted when the tokens from `fromTokenId` to `toTokenId` are transferred from `fromAddress` to `toAddress`. 14 | */ 15 | event ConsecutiveTransfer( 16 | uint256 indexed fromTokenId, 17 | uint256 toTokenId, 18 | address indexed fromAddress, 19 | address indexed toAddress 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorCompMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../governance/extensions/GovernorCountingSimple.sol"; 6 | import "../../governance/extensions/GovernorVotesComp.sol"; 7 | 8 | abstract contract GovernorCompMock is GovernorVotesComp, GovernorCountingSimple { 9 | function quorum(uint256) public pure override returns (uint256) { 10 | return 0; 11 | } 12 | 13 | function votingDelay() public pure override returns (uint256) { 14 | return 4; 15 | } 16 | 17 | function votingPeriod() public pure override returns (uint256) { 18 | return 16; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/token/erc20/IERC20Metadata.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | import "./IERC20.sol"; 4 | 5 | /** 6 | * @dev Interface for the optional metadata functions from the ERC20 standard. 7 | * 8 | * _Available since v4.1._ 9 | */ 10 | interface IERC20Metadata is IERC20 { 11 | /** 12 | * @dev Returns the name of the token. 13 | */ 14 | function name() external view returns (string memory); 15 | 16 | /** 17 | * @dev Returns the symbol of the token. 18 | */ 19 | function symbol() external view returns (string memory); 20 | 21 | /** 22 | * @dev Returns the decimals places of the token. 23 | */ 24 | function decimals() external view returns (uint8); 25 | } 26 | -------------------------------------------------------------------------------- /lib/forge-std/test/Vm.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0 <0.9.0; 3 | 4 | import {Test} from "../src/Test.sol"; 5 | import {Vm, VmSafe} from "../src/Vm.sol"; 6 | 7 | // These tests ensure that functions are never accidentally removed from a Vm interface, or 8 | // inadvertently moved between Vm and VmSafe. These tests must be updated each time a function is 9 | // added to or removed from Vm or VmSafe. 10 | contract VmTest is Test { 11 | function test_VmInterfaceId() public pure { 12 | assertEq(type(Vm).interfaceId, bytes4(0xdb28dd7b), "Vm"); 13 | } 14 | 15 | function test_VmSafeInterfaceId() public pure { 16 | assertEq(type(VmSafe).interfaceId, bytes4(0xe76e7868), "VmSafe"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/EIP712Verifier.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/cryptography/ECDSA.sol"; 6 | import "../utils/cryptography/EIP712.sol"; 7 | 8 | abstract contract EIP712Verifier is EIP712 { 9 | function verify(bytes memory signature, address signer, address mailTo, string memory mailContents) external view { 10 | bytes32 digest = _hashTypedDataV4( 11 | keccak256(abi.encode(keccak256("Mail(address to,string contents)"), mailTo, keccak256(bytes(mailContents)))) 12 | ); 13 | address recoveredSigner = ECDSA.recover(digest, signature); 14 | require(recoveredSigner == signer); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: test 2 | 3 | on: workflow_dispatch 4 | 5 | env: 6 | FOUNDRY_PROFILE: ci 7 | 8 | jobs: 9 | check: 10 | strategy: 11 | fail-fast: true 12 | 13 | name: Foundry project 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | with: 18 | submodules: recursive 19 | 20 | - name: Install Foundry 21 | uses: foundry-rs/foundry-toolchain@v1 22 | with: 23 | version: nightly 24 | 25 | - name: Run Forge build 26 | run: | 27 | forge --version 28 | forge build --sizes 29 | id: build 30 | 31 | - name: Run Forge tests 32 | run: | 33 | forge test -vvv 34 | id: test 35 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/src/interfaces/ITrustedForwarderFactory.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | interface ITrustedForwarderFactory { 5 | error TrustedForwarderFactory__TrustedForwarderInitFailed(address admin, address appSigner); 6 | 7 | event TrustedForwarderCreated(address indexed trustedForwarder); 8 | 9 | function cloneTrustedForwarder(address admin, address appSigner, bytes32 salt) 10 | external 11 | returns (address trustedForwarder); 12 | function forwarders(address) external view returns (bool); 13 | function isTrustedForwarder(address sender) external view returns (bool); 14 | function trustedForwarderImplementation() external view returns (address); 15 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/EIP712Verifier.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/cryptography/ECDSA.sol"; 6 | import "../utils/cryptography/EIP712.sol"; 7 | 8 | abstract contract EIP712Verifier is EIP712 { 9 | function verify(bytes memory signature, address signer, address mailTo, string memory mailContents) external view { 10 | bytes32 digest = _hashTypedDataV4( 11 | keccak256(abi.encode(keccak256("Mail(address to,string contents)"), mailTo, keccak256(bytes(mailContents)))) 12 | ); 13 | address recoveredSigner = ECDSA.recover(digest, signature); 14 | require(recoveredSigner == signer); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorVoteMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../governance/extensions/GovernorCountingSimple.sol"; 6 | import "../../governance/extensions/GovernorVotes.sol"; 7 | 8 | abstract contract GovernorVoteMocks is GovernorVotes, GovernorCountingSimple { 9 | function quorum(uint256) public pure override returns (uint256) { 10 | return 0; 11 | } 12 | 13 | function votingDelay() public pure override returns (uint256) { 14 | return 4; 15 | } 16 | 17 | function votingPeriod() public pure override returns (uint256) { 18 | return 16; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/tm-core-lib/src/utils/misc/StorageTstorish.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.24; 2 | 3 | library StorageTstorish { 4 | // keccak256(abi.encode(uint256(keccak256("storage.Tstorish")) - 1)) & ~bytes32(uint256(0xff)) 5 | bytes32 private constant DATA_STORAGE_SLOT = 6 | 0xdacd49f6a6c42b45a5c3d195b83b324104542d9147bb8064a39c6a8d23ba9b00; 7 | 8 | struct Data { 9 | // Indicates if TSTORE support has been activated during or post-deployment. 10 | bool tstoreSupport; 11 | } 12 | 13 | function data() internal pure returns (Data storage ptr) { 14 | bytes32 slot = DATA_STORAGE_SLOT; 15 | assembly { 16 | ptr.slot := slot 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/src/pools/standard-token-pool/StandardPoolCreationCode.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: LicenseRef-PolyForm-Strict-1.0.0 2 | pragma solidity 0.8.24; 3 | 4 | import "./StandardPool.sol"; 5 | import "@limitbreak/tm-core-lib/src/licenses/LicenseRef-PolyForm-Strict-1.0.0.sol"; 6 | 7 | /** 8 | * @title StandardPoolCreationCode 9 | * @author Limit Break, Inc. 10 | * @notice Stores the creation code for a TokenMaster Standard Pool to use in factory deployments. 11 | */ 12 | contract StandardPoolCreationCode { 13 | 14 | constructor() { 15 | bytes memory creationCode = type(StandardPool).creationCode; 16 | assembly ("memory-safe") { 17 | return(add(0x20, creationCode), mload(creationCode)) 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorCompMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../governance/extensions/GovernorCountingSimple.sol"; 6 | import "../../governance/extensions/GovernorVotesComp.sol"; 7 | 8 | abstract contract GovernorCompMock is GovernorVotesComp, GovernorCountingSimple { 9 | function quorum(uint256) public pure override returns (uint256) { 10 | return 0; 11 | } 12 | 13 | function votingDelay() public pure override returns (uint256) { 14 | return 4; 15 | } 16 | 17 | function votingPeriod() public pure override returns (uint256) { 18 | return 16; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC2309.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.8.0) (interfaces/IERC2309.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev ERC-2309: ERC-721 Consecutive Transfer Extension. 8 | * 9 | * _Available since v4.8._ 10 | */ 11 | interface IERC2309 { 12 | /** 13 | * @dev Emitted when the tokens from `fromTokenId` to `toTokenId` are transferred from `fromAddress` to `toAddress`. 14 | */ 15 | event ConsecutiveTransfer( 16 | uint256 indexed fromTokenId, 17 | uint256 toTokenId, 18 | address indexed fromAddress, 19 | address indexed toAddress 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/src/pools/promotional-pool/PromotionalPoolCreationCode.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: LicenseRef-PolyForm-Strict-1.0.0 2 | pragma solidity 0.8.24; 3 | 4 | import "./PromotionalPool.sol"; 5 | import "@limitbreak/tm-core-lib/src/licenses/LicenseRef-PolyForm-Strict-1.0.0.sol"; 6 | 7 | /** 8 | * @title PromotionalPoolCreationCode 9 | * @author Limit Break, Inc. 10 | * @notice Stores the init code for a TokenMaster Promotional Pool to use in factory deployments. 11 | */ 12 | contract PromotionalPoolCreationCode { 13 | 14 | constructor() { 15 | bytes memory creationCode = type(PromotionalPool).creationCode; 16 | assembly ("memory-safe") { 17 | return(add(0x20, creationCode), mload(creationCode)) 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/test/mocks/MockPairedTokenERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.24; 3 | 4 | import "@limitbreak/tm-core-lib/src/token/erc20/ERC20.sol"; 5 | 6 | contract MockPairedTokenERC20 is ERC20 { 7 | uint8 internal _decimals; 8 | 9 | constructor(string memory name_, string memory symbol_, uint8 decimals_) ERC20(name_, symbol_) { 10 | _decimals = decimals_; 11 | } 12 | 13 | function decimals() public view virtual override returns (uint8) { 14 | return _decimals; 15 | } 16 | 17 | function mint(address to, uint256 value) public virtual { 18 | _mint(to, value); 19 | } 20 | 21 | function burn(address from, uint256 value) public virtual { 22 | _burn(from, value); 23 | } 24 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/PausableMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../security/Pausable.sol"; 6 | 7 | contract PausableMock is Pausable { 8 | bool public drasticMeasureTaken; 9 | uint256 public count; 10 | 11 | constructor() { 12 | drasticMeasureTaken = false; 13 | count = 0; 14 | } 15 | 16 | function normalProcess() external whenNotPaused { 17 | count++; 18 | } 19 | 20 | function drasticMeasure() external whenPaused { 21 | drasticMeasureTaken = true; 22 | } 23 | 24 | function pause() external { 25 | _pause(); 26 | } 27 | 28 | function unpause() external { 29 | _unpause(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC1155Receiver.sol"; 7 | import "../../../utils/introspection/ERC165.sol"; 8 | 9 | /** 10 | * @dev _Available since v3.1._ 11 | */ 12 | abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { 13 | /** 14 | * @dev See {IERC165-supportsInterface}. 15 | */ 16 | function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { 17 | return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/EIP712Verifier.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/cryptography/ECDSA.sol"; 6 | import "../utils/cryptography/EIP712.sol"; 7 | 8 | abstract contract EIP712Verifier is EIP712 { 9 | function verify(bytes memory signature, address signer, address mailTo, string memory mailContents) external view { 10 | bytes32 digest = _hashTypedDataV4( 11 | keccak256(abi.encode(keccak256("Mail(address to,string contents)"), mailTo, keccak256(bytes(mailContents)))) 12 | ); 13 | address recoveredSigner = ECDSA.recover(digest, signature); 14 | require(recoveredSigner == signer); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC1155Receiver.sol"; 7 | import "../../../utils/introspection/ERC165.sol"; 8 | 9 | /** 10 | * @dev _Available since v3.1._ 11 | */ 12 | abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { 13 | /** 14 | * @dev See {IERC165-supportsInterface}. 15 | */ 16 | function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { 17 | return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/PausableMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../security/Pausable.sol"; 6 | 7 | contract PausableMock is Pausable { 8 | bool public drasticMeasureTaken; 9 | uint256 public count; 10 | 11 | constructor() { 12 | drasticMeasureTaken = false; 13 | count = 0; 14 | } 15 | 16 | function normalProcess() external whenNotPaused { 17 | count++; 18 | } 19 | 20 | function drasticMeasure() external whenPaused { 21 | drasticMeasureTaken = true; 22 | } 23 | 24 | function pause() external { 25 | _pause(); 26 | } 27 | 28 | function unpause() external { 29 | _unpause(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/TimelockReentrant.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import "../utils/Address.sol"; 5 | 6 | contract TimelockReentrant { 7 | address private _reenterTarget; 8 | bytes private _reenterData; 9 | bool _reentered; 10 | 11 | function disableReentrancy() external { 12 | _reentered = true; 13 | } 14 | 15 | function enableRentrancy(address target, bytes calldata data) external { 16 | _reenterTarget = target; 17 | _reenterData = data; 18 | } 19 | 20 | function reenter() external { 21 | if (!_reentered) { 22 | _reentered = true; 23 | Address.functionCall(_reenterTarget, _reenterData); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/token/erc721/IERC721Metadata.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | import "./IERC721.sol"; 4 | 5 | /** 6 | * @title ERC-721 Non-Fungible Token Standard, optional metadata extension 7 | * @dev See https://eips.ethereum.org/EIPS/eip-721 8 | */ 9 | interface IERC721Metadata is IERC721 { 10 | /** 11 | * @dev Returns the token collection name. 12 | */ 13 | function name() external view returns (string memory); 14 | 15 | /** 16 | * @dev Returns the token collection symbol. 17 | */ 18 | function symbol() external view returns (string memory); 19 | 20 | /** 21 | * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. 22 | */ 23 | function tokenURI(uint256 tokenId) external view returns (string memory); 24 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/TimelockReentrant.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import "../utils/Address.sol"; 5 | 6 | contract TimelockReentrant { 7 | address private _reenterTarget; 8 | bytes private _reenterData; 9 | bool _reentered; 10 | 11 | function disableReentrancy() external { 12 | _reentered = true; 13 | } 14 | 15 | function enableRentrancy(address target, bytes calldata data) external { 16 | _reenterTarget = target; 17 | _reenterData = data; 18 | } 19 | 20 | function reenter() external { 21 | if (!_reentered) { 22 | _reentered = true; 23 | Address.functionCall(_reenterTarget, _reenterData); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface of the ERC1271 standard signature validation method for 8 | * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. 9 | * 10 | * _Available since v4.1._ 11 | */ 12 | interface IERC1271 { 13 | /** 14 | * @dev Should return whether the signature provided is valid for the provided data 15 | * @param hash Hash of the data to be signed 16 | * @param signature Signature byte array associated with _data 17 | */ 18 | function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); 19 | } 20 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/PausableMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../security/Pausable.sol"; 6 | 7 | contract PausableMock is Pausable { 8 | bool public drasticMeasureTaken; 9 | uint256 public count; 10 | 11 | constructor() { 12 | drasticMeasureTaken = false; 13 | count = 0; 14 | } 15 | 16 | function normalProcess() external whenNotPaused { 17 | count++; 18 | } 19 | 20 | function drasticMeasure() external whenPaused { 21 | drasticMeasureTaken = true; 22 | } 23 | 24 | function pause() external { 25 | _pause(); 26 | } 27 | 28 | function unpause() external { 29 | _unpause(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC1155Receiver.sol"; 7 | import "../../../utils/introspection/ERC165.sol"; 8 | 9 | /** 10 | * @dev _Available since v3.1._ 11 | */ 12 | abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { 13 | /** 14 | * @dev See {IERC165-supportsInterface}. 15 | */ 16 | function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { 17 | return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface of the ERC1271 standard signature validation method for 8 | * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. 9 | * 10 | * _Available since v4.1._ 11 | */ 12 | interface IERC1271 { 13 | /** 14 | * @dev Should return whether the signature provided is valid for the provided data 15 | * @param hash Hash of the data to be signed 16 | * @param signature Signature byte array associated with _data 17 | */ 18 | function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); 19 | } 20 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/extensibility/IExtensible.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | interface IExtensible { 4 | event ExtensionInstalled(address indexed extensionAddress); 5 | event ExtensionUninstalled(address indexed extensionAddress); 6 | event ExtensionSelectorInstalled(address indexed extensionAddress, bytes4 indexed selector); 7 | event ExtensionSelectorUninstalled(address indexed extensionAddress, bytes4 indexed selector); 8 | 9 | function installExtensions(address[] calldata /*extensionAddresses*/) external; 10 | function uninstallExtensions(address[] calldata /*extensionAddresses*/) external; 11 | 12 | function isExtensionInstalled(address /*extensionAddress*/) external view returns (bool); 13 | 14 | function extensibleTypes() external view returns (uint256[] memory); 15 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/TimelockReentrant.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import "../utils/Address.sol"; 5 | 6 | contract TimelockReentrant { 7 | address private _reenterTarget; 8 | bytes private _reenterData; 9 | bool _reentered; 10 | 11 | function disableReentrancy() external { 12 | _reentered = true; 13 | } 14 | 15 | function enableRentrancy(address target, bytes calldata data) external { 16 | _reenterTarget = target; 17 | _reenterData = data; 18 | } 19 | 20 | function reenter() external { 21 | if (!_reentered) { 22 | _reentered = true; 23 | Address.functionCall(_reenterTarget, _reenterData); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/security/README.adoc: -------------------------------------------------------------------------------- 1 | = Security 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/security 5 | 6 | These contracts aim to cover common security practices. 7 | 8 | * {PullPayment}: A pattern that can be used to avoid reentrancy attacks. 9 | * {ReentrancyGuard}: A modifier that can prevent reentrancy during certain functions. 10 | * {Pausable}: A common emergency response mechanism that can pause functionality while a remediation is pending. 11 | 12 | TIP: For an overview on reentrancy and the possible mechanisms to prevent it, read our article https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. 13 | 14 | == Contracts 15 | 16 | {{PullPayment}} 17 | 18 | {{ReentrancyGuard}} 19 | 20 | {{Pausable}} 21 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC. 8 | * 9 | * _Available since v4.8.3._ 10 | */ 11 | interface IERC1967 { 12 | /** 13 | * @dev Emitted when the implementation is upgraded. 14 | */ 15 | event Upgraded(address indexed implementation); 16 | 17 | /** 18 | * @dev Emitted when the admin account has changed. 19 | */ 20 | event AdminChanged(address previousAdmin, address newAdmin); 21 | 22 | /** 23 | * @dev Emitted when the beacon is changed. 24 | */ 25 | event BeaconUpgraded(address indexed beacon); 26 | } 27 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface of the ERC1271 standard signature validation method for 8 | * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. 9 | * 10 | * _Available since v4.1._ 11 | */ 12 | interface IERC1271 { 13 | /** 14 | * @dev Should return whether the signature provided is valid for the provided data 15 | * @param hash Hash of the data to be signed 16 | * @param signature Signature byte array associated with _data 17 | */ 18 | function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); 19 | } 20 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC. 8 | * 9 | * _Available since v4.8.3._ 10 | */ 11 | interface IERC1967 { 12 | /** 13 | * @dev Emitted when the implementation is upgraded. 14 | */ 15 | event Upgraded(address indexed implementation); 16 | 17 | /** 18 | * @dev Emitted when the admin account has changed. 19 | */ 20 | event AdminChanged(address previousAdmin, address newAdmin); 21 | 22 | /** 23 | * @dev Emitted when the beacon is changed. 24 | */ 25 | event BeaconUpgraded(address indexed beacon); 26 | } 27 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/security/README.adoc: -------------------------------------------------------------------------------- 1 | = Security 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/security 5 | 6 | These contracts aim to cover common security practices. 7 | 8 | * {PullPayment}: A pattern that can be used to avoid reentrancy attacks. 9 | * {ReentrancyGuard}: A modifier that can prevent reentrancy during certain functions. 10 | * {Pausable}: A common emergency response mechanism that can pause functionality while a remediation is pending. 11 | 12 | TIP: For an overview on reentrancy and the possible mechanisms to prevent it, read our article https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. 13 | 14 | == Contracts 15 | 16 | {{PullPayment}} 17 | 18 | {{ReentrancyGuard}} 19 | 20 | {{Pausable}} 21 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC1155.sol"; 7 | 8 | /** 9 | * @dev Interface of the optional ERC1155MetadataExtension interface, as defined 10 | * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. 11 | * 12 | * _Available since v3.1._ 13 | */ 14 | interface IERC1155MetadataURI is IERC1155 { 15 | /** 16 | * @dev Returns the URI for token type `id`. 17 | * 18 | * If the `\{id\}` substring is present in the URI, it must be replaced by 19 | * clients with the actual token type ID. 20 | */ 21 | function uri(uint256 id) external view returns (string memory); 22 | } 23 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC1155.sol"; 7 | 8 | /** 9 | * @dev Interface of the optional ERC1155MetadataExtension interface, as defined 10 | * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. 11 | * 12 | * _Available since v3.1._ 13 | */ 14 | interface IERC1155MetadataURI is IERC1155 { 15 | /** 16 | * @dev Returns the URI for token type `id`. 17 | * 18 | * If the `\{id\}` substring is present in the URI, it must be replaced by 19 | * clients with the actual token type ID. 20 | */ 21 | function uri(uint256 id) external view returns (string memory); 22 | } 23 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/token/common/IERC2981.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | import "../../utils/introspection/IERC165.sol"; 4 | 5 | /** 6 | * @dev Interface for the NFT Royalty Standard. 7 | * 8 | * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal 9 | * support for royalty payments across all NFT marketplaces and ecosystem participants. 10 | */ 11 | interface IERC2981 is IERC165 { 12 | /** 13 | * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of 14 | * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. 15 | */ 16 | function royaltyInfo( 17 | uint256 tokenId, 18 | uint256 salePrice 19 | ) external view returns (address receiver, uint256 royaltyAmount); 20 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorProposalThreshold.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (governance/extensions/GovernorProposalThreshold.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../Governor.sol"; 7 | 8 | /** 9 | * @dev Extension of {Governor} for proposal restriction to token holders with a minimum balance. 10 | * 11 | * _Available since v4.3._ 12 | * _Deprecated since v4.4._ 13 | */ 14 | abstract contract GovernorProposalThreshold is Governor { 15 | function propose( 16 | address[] memory targets, 17 | uint256[] memory values, 18 | bytes[] memory calldatas, 19 | string memory description 20 | ) public virtual override returns (uint256) { 21 | return super.propose(targets, values, calldatas, description); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/MulticallTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "./token/ERC20MulticallMock.sol"; 6 | 7 | contract MulticallTest { 8 | function checkReturnValues( 9 | ERC20MulticallMock multicallToken, 10 | address[] calldata recipients, 11 | uint256[] calldata amounts 12 | ) external { 13 | bytes[] memory calls = new bytes[](recipients.length); 14 | for (uint256 i = 0; i < recipients.length; i++) { 15 | calls[i] = abi.encodeWithSignature("transfer(address,uint256)", recipients[i], amounts[i]); 16 | } 17 | 18 | bytes[] memory results = multicallToken.multicall(calls); 19 | for (uint256 i = 0; i < results.length; i++) { 20 | require(abi.decode(results[i], (bool))); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC20FlashMintMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/extensions/ERC20FlashMint.sol"; 6 | 7 | abstract contract ERC20FlashMintMock is ERC20FlashMint { 8 | uint256 _flashFeeAmount; 9 | address _flashFeeReceiverAddress; 10 | 11 | function setFlashFee(uint256 amount) public { 12 | _flashFeeAmount = amount; 13 | } 14 | 15 | function _flashFee(address, uint256) internal view override returns (uint256) { 16 | return _flashFeeAmount; 17 | } 18 | 19 | function setFlashFeeReceiver(address receiver) public { 20 | _flashFeeReceiverAddress = receiver; 21 | } 22 | 23 | function _flashFeeReceiver() internal view override returns (address) { 24 | return _flashFeeReceiverAddress; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorProposalThreshold.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (governance/extensions/GovernorProposalThreshold.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../Governor.sol"; 7 | 8 | /** 9 | * @dev Extension of {Governor} for proposal restriction to token holders with a minimum balance. 10 | * 11 | * _Available since v4.3._ 12 | * _Deprecated since v4.4._ 13 | */ 14 | abstract contract GovernorProposalThreshold is Governor { 15 | function propose( 16 | address[] memory targets, 17 | uint256[] memory values, 18 | bytes[] memory calldatas, 19 | string memory description 20 | ) public virtual override returns (uint256) { 21 | return super.propose(targets, values, calldatas, description); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC. 8 | * 9 | * _Available since v4.8.3._ 10 | */ 11 | interface IERC1967 { 12 | /** 13 | * @dev Emitted when the implementation is upgraded. 14 | */ 15 | event Upgraded(address indexed implementation); 16 | 17 | /** 18 | * @dev Emitted when the admin account has changed. 19 | */ 20 | event AdminChanged(address previousAdmin, address newAdmin); 21 | 22 | /** 23 | * @dev Emitted when the beacon is changed. 24 | */ 25 | event BeaconUpgraded(address indexed beacon); 26 | } 27 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/security/README.adoc: -------------------------------------------------------------------------------- 1 | = Security 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/security 5 | 6 | These contracts aim to cover common security practices. 7 | 8 | * {PullPayment}: A pattern that can be used to avoid reentrancy attacks. 9 | * {ReentrancyGuard}: A modifier that can prevent reentrancy during certain functions. 10 | * {Pausable}: A common emergency response mechanism that can pause functionality while a remediation is pending. 11 | 12 | TIP: For an overview on reentrancy and the possible mechanisms to prevent it, read our article https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. 13 | 14 | == Contracts 15 | 16 | {{PullPayment}} 17 | 18 | {{ReentrancyGuard}} 19 | 20 | {{Pausable}} 21 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC20.sol"; 7 | 8 | /** 9 | * @dev Interface for the optional metadata functions from the ERC20 standard. 10 | * 11 | * _Available since v4.1._ 12 | */ 13 | interface IERC20Metadata is IERC20 { 14 | /** 15 | * @dev Returns the name of the token. 16 | */ 17 | function name() external view returns (string memory); 18 | 19 | /** 20 | * @dev Returns the symbol of the token. 21 | */ 22 | function symbol() external view returns (string memory); 23 | 24 | /** 25 | * @dev Returns the decimals places of the token. 26 | */ 27 | function decimals() external view returns (uint8); 28 | } 29 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/introspection/IERC165.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | /** 4 | * @dev Interface of the ERC-165 standard, as defined in the 5 | * https://eips.ethereum.org/EIPS/eip-165[ERC]. 6 | * 7 | * Implementers can declare support of contract interfaces, which can then be 8 | * queried by others ({ERC165Checker}). 9 | * 10 | * For an implementation, see {ERC165}. 11 | */ 12 | interface IERC165 { 13 | /** 14 | * @dev Returns true if this contract implements the interface defined by 15 | * `interfaceId`. See the corresponding 16 | * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] 17 | * to learn more about how these ids are created. 18 | * 19 | * This function call must use less than 30 000 gas. 20 | */ 21 | function supportsInterface(bytes4 interfaceId) external view returns (bool); 22 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/MulticallTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "./token/ERC20MulticallMock.sol"; 6 | 7 | contract MulticallTest { 8 | function checkReturnValues( 9 | ERC20MulticallMock multicallToken, 10 | address[] calldata recipients, 11 | uint256[] calldata amounts 12 | ) external { 13 | bytes[] memory calls = new bytes[](recipients.length); 14 | for (uint256 i = 0; i < recipients.length; i++) { 15 | calls[i] = abi.encodeWithSignature("transfer(address,uint256)", recipients[i], amounts[i]); 16 | } 17 | 18 | bytes[] memory results = multicallToken.multicall(calls); 19 | for (uint256 i = 0; i < results.length; i++) { 20 | require(abi.decode(results[i], (bool))); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/token/ERC20FlashMintMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/extensions/ERC20FlashMint.sol"; 6 | 7 | abstract contract ERC20FlashMintMock is ERC20FlashMint { 8 | uint256 _flashFeeAmount; 9 | address _flashFeeReceiverAddress; 10 | 11 | function setFlashFee(uint256 amount) public { 12 | _flashFeeAmount = amount; 13 | } 14 | 15 | function _flashFee(address, uint256) internal view override returns (uint256) { 16 | return _flashFeeAmount; 17 | } 18 | 19 | function setFlashFeeReceiver(address receiver) public { 20 | _flashFeeReceiverAddress = receiver; 21 | } 22 | 23 | function _flashFeeReceiver() internal view override returns (address) { 24 | return _flashFeeReceiverAddress; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/forge-std/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | fs_permissions = [{ access = "read-write", path = "./"}] 3 | 4 | [rpc_endpoints] 5 | # The RPC URLs are modified versions of the default for testing initialization. 6 | mainnet = "https://eth-mainnet.alchemyapi.io/v2/WV407BEiBmjNJfKo9Uo_55u0z0ITyCOX" # Different API key. 7 | optimism_sepolia = "https://sepolia.optimism.io/" # Adds a trailing slash. 8 | arbitrum_one_sepolia = "https://sepolia-rollup.arbitrum.io/rpc/" # Adds a trailing slash. 9 | needs_undefined_env_var = "${UNDEFINED_RPC_URL_PLACEHOLDER}" 10 | 11 | [fmt] 12 | # These are all the `forge fmt` defaults. 13 | line_length = 120 14 | tab_width = 4 15 | bracket_spacing = false 16 | int_types = 'long' 17 | multiline_func_header = 'attributes_first' 18 | quote_style = 'double' 19 | number_underscore = 'preserve' 20 | single_line_statement_blocks = 'preserve' 21 | ignore = ["src/console.sol", "src/console2.sol"] -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC20.sol"; 7 | 8 | /** 9 | * @dev Interface for the optional metadata functions from the ERC20 standard. 10 | * 11 | * _Available since v4.1._ 12 | */ 13 | interface IERC20Metadata is IERC20 { 14 | /** 15 | * @dev Returns the name of the token. 16 | */ 17 | function name() external view returns (string memory); 18 | 19 | /** 20 | * @dev Returns the symbol of the token. 21 | */ 22 | function symbol() external view returns (string memory); 23 | 24 | /** 25 | * @dev Returns the decimals places of the token. 26 | */ 27 | function decimals() external view returns (uint8); 28 | } 29 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC1155.sol"; 7 | 8 | /** 9 | * @dev Interface of the optional ERC1155MetadataExtension interface, as defined 10 | * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. 11 | * 12 | * _Available since v3.1._ 13 | */ 14 | interface IERC1155MetadataURI is IERC1155 { 15 | /** 16 | * @dev Returns the URI for token type `id`. 17 | * 18 | * If the `\{id\}` substring is present in the URI, it must be replaced by 19 | * clients with the actual token type ID. 20 | */ 21 | function uri(uint256 id) external view returns (string memory); 22 | } 23 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorProposalThreshold.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (governance/extensions/GovernorProposalThreshold.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../Governor.sol"; 7 | 8 | /** 9 | * @dev Extension of {Governor} for proposal restriction to token holders with a minimum balance. 10 | * 11 | * _Available since v4.3._ 12 | * _Deprecated since v4.4._ 13 | */ 14 | abstract contract GovernorProposalThreshold is Governor { 15 | function propose( 16 | address[] memory targets, 17 | uint256[] memory values, 18 | bytes[] memory calldatas, 19 | string memory description 20 | ) public virtual override returns (uint256) { 21 | return super.propose(targets, values, calldatas, description); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC20NoReturnMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/ERC20.sol"; 6 | 7 | abstract contract ERC20NoReturnMock is ERC20 { 8 | function transfer(address to, uint256 amount) public override returns (bool) { 9 | super.transfer(to, amount); 10 | assembly { 11 | return(0, 0) 12 | } 13 | } 14 | 15 | function transferFrom(address from, address to, uint256 amount) public override returns (bool) { 16 | super.transferFrom(from, to, amount); 17 | assembly { 18 | return(0, 0) 19 | } 20 | } 21 | 22 | function approve(address spender, uint256 amount) public override returns (bool) { 23 | super.approve(spender, amount); 24 | assembly { 25 | return(0, 0) 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/MulticallTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "./token/ERC20MulticallMock.sol"; 6 | 7 | contract MulticallTest { 8 | function checkReturnValues( 9 | ERC20MulticallMock multicallToken, 10 | address[] calldata recipients, 11 | uint256[] calldata amounts 12 | ) external { 13 | bytes[] memory calls = new bytes[](recipients.length); 14 | for (uint256 i = 0; i < recipients.length; i++) { 15 | calls[i] = abi.encodeWithSignature("transfer(address,uint256)", recipients[i], amounts[i]); 16 | } 17 | 18 | bytes[] memory results = multicallToken.multicall(calls); 19 | for (uint256 i = 0; i < results.length; i++) { 20 | require(abi.decode(results[i], (bool))); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC20FlashMintMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/extensions/ERC20FlashMint.sol"; 6 | 7 | abstract contract ERC20FlashMintMock is ERC20FlashMint { 8 | uint256 _flashFeeAmount; 9 | address _flashFeeReceiverAddress; 10 | 11 | function setFlashFee(uint256 amount) public { 12 | _flashFeeAmount = amount; 13 | } 14 | 15 | function _flashFee(address, uint256) internal view override returns (uint256) { 16 | return _flashFeeAmount; 17 | } 18 | 19 | function setFlashFeeReceiver(address receiver) public { 20 | _flashFeeReceiverAddress = receiver; 21 | } 22 | 23 | function _flashFeeReceiver() internal view override returns (address) { 24 | return _flashFeeReceiverAddress; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/finance/README.adoc: -------------------------------------------------------------------------------- 1 | = Finance 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/finance 5 | 6 | This directory includes primitives for financial systems: 7 | 8 | - {PaymentSplitter} allows to split Ether and ERC20 payments among a group of accounts. The sender does not need to be 9 | aware that the assets will be split in this way, since it is handled transparently by the contract. The split can be 10 | in equal parts or in any other arbitrary proportion. 11 | 12 | - {VestingWallet} handles the vesting of Ether and ERC20 tokens for a given beneficiary. Custody of multiple tokens can 13 | be given to this contract, which will release the token to the beneficiary following a given, customizable, vesting 14 | schedule. 15 | 16 | == Contracts 17 | 18 | {{PaymentSplitter}} 19 | 20 | {{VestingWallet}} 21 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/tm-core-lib/src/utils/introspection/IERC165.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | /** 4 | * @dev Interface of the ERC-165 standard, as defined in the 5 | * https://eips.ethereum.org/EIPS/eip-165[ERC]. 6 | * 7 | * Implementers can declare support of contract interfaces, which can then be 8 | * queried by others ({ERC165Checker}). 9 | * 10 | * For an implementation, see {ERC165}. 11 | */ 12 | interface IERC165 { 13 | /** 14 | * @dev Returns true if this contract implements the interface defined by 15 | * `interfaceId`. See the corresponding 16 | * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] 17 | * to learn more about how these ids are created. 18 | * 19 | * This function call must use less than 30 000 gas. 20 | */ 21 | function supportsInterface(bytes4 interfaceId) external view returns (bool); 22 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/tm-core-lib/src/utils/introspection/ERC165.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | import "./IERC165.sol"; 4 | 5 | /** 6 | * @dev Implementation of the {IERC165} interface. 7 | * 8 | * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check 9 | * for the additional interface id that will be supported. For example: 10 | * 11 | * ```solidity 12 | * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { 13 | * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); 14 | * } 15 | * ``` 16 | */ 17 | abstract contract ERC165 is IERC165 { 18 | /** 19 | * @dev See {IERC165-supportsInterface}. 20 | */ 21 | function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { 22 | return interfaceId == type(IERC165).interfaceId; 23 | } 24 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC5267.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5267.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | interface IERC5267 { 7 | /** 8 | * @dev MAY be emitted to signal that the domain could have changed. 9 | */ 10 | event EIP712DomainChanged(); 11 | 12 | /** 13 | * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712 14 | * signature. 15 | */ 16 | function eip712Domain() 17 | external 18 | view 19 | returns ( 20 | bytes1 fields, 21 | string memory name, 22 | string memory version, 23 | uint256 chainId, 24 | address verifyingContract, 25 | bytes32 salt, 26 | uint256[] memory extensions 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/utils/introspection/IERC1820Implementer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC1820Implementer.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface for an ERC1820 implementer, as defined in the 8 | * https://eips.ethereum.org/EIPS/eip-1820#interface-implementation-erc1820implementerinterface[EIP]. 9 | * Used by contracts that will be registered as implementers in the 10 | * {IERC1820Registry}. 11 | */ 12 | interface IERC1820Implementer { 13 | /** 14 | * @dev Returns a special value (`ERC1820_ACCEPT_MAGIC`) if this contract 15 | * implements `interfaceHash` for `account`. 16 | * 17 | * See {IERC1820Registry-setInterfaceImplementer}. 18 | */ 19 | function canImplementInterfaceForAddress(bytes32 interfaceHash, address account) external view returns (bytes32); 20 | } 21 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/token/ERC20NoReturnMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/ERC20.sol"; 6 | 7 | abstract contract ERC20NoReturnMock is ERC20 { 8 | function transfer(address to, uint256 amount) public override returns (bool) { 9 | super.transfer(to, amount); 10 | assembly { 11 | return(0, 0) 12 | } 13 | } 14 | 15 | function transferFrom(address from, address to, uint256 amount) public override returns (bool) { 16 | super.transferFrom(from, to, amount); 17 | assembly { 18 | return(0, 0) 19 | } 20 | } 21 | 22 | function approve(address spender, uint256 amount) public override returns (bool) { 23 | super.approve(spender, amount); 24 | assembly { 25 | return(0, 0) 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC20.sol"; 7 | 8 | /** 9 | * @dev Interface for the optional metadata functions from the ERC20 standard. 10 | * 11 | * _Available since v4.1._ 12 | */ 13 | interface IERC20Metadata is IERC20 { 14 | /** 15 | * @dev Returns the name of the token. 16 | */ 17 | function name() external view returns (string memory); 18 | 19 | /** 20 | * @dev Returns the symbol of the token. 21 | */ 22 | function symbol() external view returns (string memory); 23 | 24 | /** 25 | * @dev Returns the decimals places of the token. 26 | */ 27 | function decimals() external view returns (uint8); 28 | } 29 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/vendor/arbitrum/IDelayedMessageProvider.sol: -------------------------------------------------------------------------------- 1 | // Copyright 2021-2022, Offchain Labs, Inc. 2 | // For license information, see https://github.com/nitro/blob/master/LICENSE 3 | // SPDX-License-Identifier: BUSL-1.1 4 | // OpenZeppelin Contracts (last updated v4.8.0) (vendor/arbitrum/IDelayedMessageProvider.sol) 5 | 6 | // solhint-disable-next-line compiler-version 7 | pragma solidity >=0.6.9 <0.9.0; 8 | 9 | interface IDelayedMessageProvider { 10 | /// @dev event emitted when a inbox message is added to the Bridge's delayed accumulator 11 | event InboxMessageDelivered(uint256 indexed messageNum, bytes data); 12 | 13 | /// @dev event emitted when a inbox message is added to the Bridge's delayed accumulator 14 | /// same as InboxMessageDelivered but the batch data is available in tx.input 15 | event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum); 16 | } 17 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/finance/README.adoc: -------------------------------------------------------------------------------- 1 | = Finance 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/finance 5 | 6 | This directory includes primitives for financial systems: 7 | 8 | - {PaymentSplitter} allows to split Ether and ERC20 payments among a group of accounts. The sender does not need to be 9 | aware that the assets will be split in this way, since it is handled transparently by the contract. The split can be 10 | in equal parts or in any other arbitrary proportion. 11 | 12 | - {VestingWallet} handles the vesting of Ether and ERC20 tokens for a given beneficiary. Custody of multiple tokens can 13 | be given to this contract, which will release the token to the beneficiary following a given, customizable, vesting 14 | schedule. 15 | 16 | == Contracts 17 | 18 | {{PaymentSplitter}} 19 | 20 | {{VestingWallet}} 21 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/governance/extensions/IGovernorTimelock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (governance/extensions/IGovernorTimelock.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IGovernor.sol"; 7 | 8 | /** 9 | * @dev Extension of the {IGovernor} for timelock supporting modules. 10 | * 11 | * _Available since v4.3._ 12 | */ 13 | abstract contract IGovernorTimelock is IGovernor { 14 | event ProposalQueued(uint256 proposalId, uint256 eta); 15 | 16 | function timelock() public view virtual returns (address); 17 | 18 | function proposalEta(uint256 proposalId) public view virtual returns (uint256); 19 | 20 | function queue( 21 | address[] memory targets, 22 | uint256[] memory values, 23 | bytes[] memory calldatas, 24 | bytes32 descriptionHash 25 | ) public virtual returns (uint256 proposalId); 26 | } 27 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC5267.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5267.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | interface IERC5267 { 7 | /** 8 | * @dev MAY be emitted to signal that the domain could have changed. 9 | */ 10 | event EIP712DomainChanged(); 11 | 12 | /** 13 | * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712 14 | * signature. 15 | */ 16 | function eip712Domain() 17 | external 18 | view 19 | returns ( 20 | bytes1 fields, 21 | string memory name, 22 | string memory version, 23 | uint256 chainId, 24 | address verifyingContract, 25 | bytes32 salt, 26 | uint256[] memory extensions 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/utils/introspection/IERC1820Implementer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC1820Implementer.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface for an ERC1820 implementer, as defined in the 8 | * https://eips.ethereum.org/EIPS/eip-1820#interface-implementation-erc1820implementerinterface[EIP]. 9 | * Used by contracts that will be registered as implementers in the 10 | * {IERC1820Registry}. 11 | */ 12 | interface IERC1820Implementer { 13 | /** 14 | * @dev Returns a special value (`ERC1820_ACCEPT_MAGIC`) if this contract 15 | * implements `interfaceHash` for `account`. 16 | * 17 | * See {IERC1820Registry-setInterfaceImplementer}. 18 | */ 19 | function canImplementInterfaceForAddress(bytes32 interfaceHash, address account) external view returns (bytes32); 20 | } 21 | -------------------------------------------------------------------------------- /lib/forge-std/src/Script.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | // 💬 ABOUT 5 | // Forge Std's default Script. 6 | 7 | // 🧩 MODULES 8 | import {console} from "./console.sol"; 9 | import {console2} from "./console2.sol"; 10 | import {safeconsole} from "./safeconsole.sol"; 11 | import {StdChains} from "./StdChains.sol"; 12 | import {StdCheatsSafe} from "./StdCheats.sol"; 13 | import {stdJson} from "./StdJson.sol"; 14 | import {stdMath} from "./StdMath.sol"; 15 | import {StdStorage, stdStorageSafe} from "./StdStorage.sol"; 16 | import {StdStyle} from "./StdStyle.sol"; 17 | import {StdUtils} from "./StdUtils.sol"; 18 | import {VmSafe} from "./Vm.sol"; 19 | 20 | // 📦 BOILERPLATE 21 | import {ScriptBase} from "./Base.sol"; 22 | 23 | // ⭐️ SCRIPT 24 | abstract contract Script is ScriptBase, StdChains, StdCheatsSafe, StdUtils { 25 | // Note: IS_SCRIPT() must return true. 26 | bool public IS_SCRIPT = true; 27 | } 28 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC721/utils/ERC721Holder.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/utils/ERC721Holder.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC721Receiver.sol"; 7 | 8 | /** 9 | * @dev Implementation of the {IERC721Receiver} interface. 10 | * 11 | * Accepts all token transfers. 12 | * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. 13 | */ 14 | contract ERC721Holder is IERC721Receiver { 15 | /** 16 | * @dev See {IERC721Receiver-onERC721Received}. 17 | * 18 | * Always returns `IERC721Receiver.onERC721Received.selector`. 19 | */ 20 | function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { 21 | return this.onERC721Received.selector; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/vendor/arbitrum/IDelayedMessageProvider.sol: -------------------------------------------------------------------------------- 1 | // Copyright 2021-2022, Offchain Labs, Inc. 2 | // For license information, see https://github.com/nitro/blob/master/LICENSE 3 | // SPDX-License-Identifier: BUSL-1.1 4 | // OpenZeppelin Contracts (last updated v4.8.0) (vendor/arbitrum/IDelayedMessageProvider.sol) 5 | 6 | // solhint-disable-next-line compiler-version 7 | pragma solidity >=0.6.9 <0.9.0; 8 | 9 | interface IDelayedMessageProvider { 10 | /// @dev event emitted when a inbox message is added to the Bridge's delayed accumulator 11 | event InboxMessageDelivered(uint256 indexed messageNum, bytes data); 12 | 13 | /// @dev event emitted when a inbox message is added to the Bridge's delayed accumulator 14 | /// same as InboxMessageDelivered but the batch data is available in tx.input 15 | event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum); 16 | } 17 | -------------------------------------------------------------------------------- /lib/forge-std/.github/workflows/sync.yml: -------------------------------------------------------------------------------- 1 | name: Sync Release Branch 2 | 3 | on: 4 | release: 5 | types: 6 | - created 7 | 8 | jobs: 9 | sync-release-branch: 10 | runs-on: ubuntu-latest 11 | if: startsWith(github.event.release.tag_name, 'v1') 12 | steps: 13 | - name: Check out the repo 14 | uses: actions/checkout@v4 15 | with: 16 | fetch-depth: 0 17 | ref: v1 18 | 19 | # The email is derived from the bots user id, 20 | # found here: https://api.github.com/users/github-actions%5Bbot%5D 21 | - name: Configure Git 22 | run: | 23 | git config user.name github-actions[bot] 24 | git config user.email 41898282+github-actions[bot]@users.noreply.github.com 25 | 26 | - name: Sync Release Branch 27 | run: | 28 | git fetch --tags 29 | git checkout v1 30 | git reset --hard ${GITHUB_REF} 31 | git push --force 32 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/governance/extensions/IGovernorTimelock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (governance/extensions/IGovernorTimelock.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IGovernor.sol"; 7 | 8 | /** 9 | * @dev Extension of the {IGovernor} for timelock supporting modules. 10 | * 11 | * _Available since v4.3._ 12 | */ 13 | abstract contract IGovernorTimelock is IGovernor { 14 | event ProposalQueued(uint256 proposalId, uint256 eta); 15 | 16 | function timelock() public view virtual returns (address); 17 | 18 | function proposalEta(uint256 proposalId) public view virtual returns (uint256); 19 | 20 | function queue( 21 | address[] memory targets, 22 | uint256[] memory values, 23 | bytes[] memory calldatas, 24 | bytes32 descriptionHash 25 | ) public virtual returns (uint256 proposalId); 26 | } 27 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/utils/Multicall.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (utils/Multicall.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "./Address.sol"; 7 | 8 | /** 9 | * @dev Provides a function to batch together multiple calls in a single external call. 10 | * 11 | * _Available since v4.1._ 12 | */ 13 | abstract contract Multicall { 14 | /** 15 | * @dev Receives and executes a batch of function calls on this contract. 16 | * @custom:oz-upgrades-unsafe-allow-reachable delegatecall 17 | */ 18 | function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) { 19 | results = new bytes[](data.length); 20 | for (uint256 i = 0; i < data.length; i++) { 21 | results[i] = Address.functionDelegateCall(address(this), data[i]); 22 | } 23 | return results; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/token/ERC721/utils/ERC721Holder.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/utils/ERC721Holder.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC721Receiver.sol"; 7 | 8 | /** 9 | * @dev Implementation of the {IERC721Receiver} interface. 10 | * 11 | * Accepts all token transfers. 12 | * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. 13 | */ 14 | contract ERC721Holder is IERC721Receiver { 15 | /** 16 | * @dev See {IERC721Receiver-onERC721Received}. 17 | * 18 | * Always returns `IERC721Receiver.onERC721Received.selector`. 19 | */ 20 | function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { 21 | return this.onERC721Received.selector; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC4906.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC4906.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "./IERC165.sol"; 7 | import "./IERC721.sol"; 8 | 9 | /// @title EIP-721 Metadata Update Extension 10 | interface IERC4906 is IERC165, IERC721 { 11 | /// @dev This event emits when the metadata of a token is changed. 12 | /// So that the third-party platforms such as NFT market could 13 | /// timely update the images and related attributes of the NFT. 14 | event MetadataUpdate(uint256 _tokenId); 15 | 16 | /// @dev This event emits when the metadata of a range of tokens is changed. 17 | /// So that the third-party platforms such as NFT market could 18 | /// timely update the images and related attributes of the NFTs. 19 | event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId); 20 | } 21 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/utils/Multicall.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (utils/Multicall.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "./Address.sol"; 7 | 8 | /** 9 | * @dev Provides a function to batch together multiple calls in a single external call. 10 | * 11 | * _Available since v4.1._ 12 | */ 13 | abstract contract Multicall { 14 | /** 15 | * @dev Receives and executes a batch of function calls on this contract. 16 | * @custom:oz-upgrades-unsafe-allow-reachable delegatecall 17 | */ 18 | function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) { 19 | results = new bytes[](data.length); 20 | for (uint256 i = 0; i < data.length; i++) { 21 | results[i] = Address.functionDelegateCall(address(this), data[i]); 22 | } 23 | return results; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/finance/README.adoc: -------------------------------------------------------------------------------- 1 | = Finance 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/finance 5 | 6 | This directory includes primitives for financial systems: 7 | 8 | - {PaymentSplitter} allows to split Ether and ERC20 payments among a group of accounts. The sender does not need to be 9 | aware that the assets will be split in this way, since it is handled transparently by the contract. The split can be 10 | in equal parts or in any other arbitrary proportion. 11 | 12 | - {VestingWallet} handles the vesting of Ether and ERC20 tokens for a given beneficiary. Custody of multiple tokens can 13 | be given to this contract, which will release the token to the beneficiary following a given, customizable, vesting 14 | schedule. 15 | 16 | == Contracts 17 | 18 | {{PaymentSplitter}} 19 | 20 | {{VestingWallet}} 21 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/token/ERC20NoReturnMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../../token/ERC20/ERC20.sol"; 6 | 7 | abstract contract ERC20NoReturnMock is ERC20 { 8 | function transfer(address to, uint256 amount) public override returns (bool) { 9 | super.transfer(to, amount); 10 | assembly { 11 | return(0, 0) 12 | } 13 | } 14 | 15 | function transferFrom(address from, address to, uint256 amount) public override returns (bool) { 16 | super.transferFrom(from, to, amount); 17 | assembly { 18 | return(0, 0) 19 | } 20 | } 21 | 22 | function approve(address spender, uint256 amount) public override returns (bool) { 23 | super.approve(spender, amount); 24 | assembly { 25 | return(0, 0) 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/tm-core-lib/src/utils/introspection/ERC165.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | import "./IERC165.sol"; 4 | 5 | /** 6 | * @dev Implementation of the {IERC165} interface. 7 | * 8 | * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check 9 | * for the additional interface id that will be supported. For example: 10 | * 11 | * ```solidity 12 | * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { 13 | * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); 14 | * } 15 | * ``` 16 | */ 17 | abstract contract ERC165 is IERC165 { 18 | /** 19 | * @dev See {IERC165-supportsInterface}. 20 | */ 21 | function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { 22 | return interfaceId == type(IERC165).interfaceId; 23 | } 24 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC721.sol"; 7 | 8 | /** 9 | * @title ERC-721 Non-Fungible Token Standard, optional metadata extension 10 | * @dev See https://eips.ethereum.org/EIPS/eip-721 11 | */ 12 | interface IERC721Metadata is IERC721 { 13 | /** 14 | * @dev Returns the token collection name. 15 | */ 16 | function name() external view returns (string memory); 17 | 18 | /** 19 | * @dev Returns the token collection symbol. 20 | */ 21 | function symbol() external view returns (string memory); 22 | 23 | /** 24 | * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. 25 | */ 26 | function tokenURI(uint256 tokenId) external view returns (string memory); 27 | } 28 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC5267.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5267.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | interface IERC5267 { 7 | /** 8 | * @dev MAY be emitted to signal that the domain could have changed. 9 | */ 10 | event EIP712DomainChanged(); 11 | 12 | /** 13 | * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712 14 | * signature. 15 | */ 16 | function eip712Domain() 17 | external 18 | view 19 | returns ( 20 | bytes1 fields, 21 | string memory name, 22 | string memory version, 23 | uint256 chainId, 24 | address verifyingContract, 25 | bytes32 salt, 26 | uint256[] memory extensions 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/utils/introspection/IERC1820Implementer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC1820Implementer.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface for an ERC1820 implementer, as defined in the 8 | * https://eips.ethereum.org/EIPS/eip-1820#interface-implementation-erc1820implementerinterface[EIP]. 9 | * Used by contracts that will be registered as implementers in the 10 | * {IERC1820Registry}. 11 | */ 12 | interface IERC1820Implementer { 13 | /** 14 | * @dev Returns a special value (`ERC1820_ACCEPT_MAGIC`) if this contract 15 | * implements `interfaceHash` for `account`. 16 | * 17 | * See {IERC1820Registry-setInterfaceImplementer}. 18 | */ 19 | function canImplementInterfaceForAddress(bytes32 interfaceHash, address account) external view returns (bytes32); 20 | } 21 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ERC2771ContextMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.9; 4 | 5 | import "./ContextMock.sol"; 6 | import "../metatx/ERC2771Context.sol"; 7 | 8 | // By inheriting from ERC2771Context, Context's internal functions are overridden automatically 9 | contract ERC2771ContextMock is ContextMock, ERC2771Context { 10 | /// @custom:oz-upgrades-unsafe-allow constructor 11 | constructor(address trustedForwarder) ERC2771Context(trustedForwarder) { 12 | emit Sender(_msgSender()); // _msgSender() should be accessible during construction 13 | } 14 | 15 | function _msgSender() internal view override(Context, ERC2771Context) returns (address) { 16 | return ERC2771Context._msgSender(); 17 | } 18 | 19 | function _msgData() internal view override(Context, ERC2771Context) returns (bytes calldata) { 20 | return ERC2771Context._msgData(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Burnable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Burnable.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../ERC721.sol"; 7 | import "../../../utils/Context.sol"; 8 | 9 | /** 10 | * @title ERC721 Burnable Token 11 | * @dev ERC721 Token that can be burned (destroyed). 12 | */ 13 | abstract contract ERC721Burnable is Context, ERC721 { 14 | /** 15 | * @dev Burns `tokenId`. See {ERC721-_burn}. 16 | * 17 | * Requirements: 18 | * 19 | * - The caller must own `tokenId` or be an approved operator. 20 | */ 21 | function burn(uint256 tokenId) public virtual { 22 | //solhint-disable-next-line max-line-length 23 | require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); 24 | _burn(tokenId); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/interfaces/IERC4906.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC4906.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "./IERC165.sol"; 7 | import "./IERC721.sol"; 8 | 9 | /// @title EIP-721 Metadata Update Extension 10 | interface IERC4906 is IERC165, IERC721 { 11 | /// @dev This event emits when the metadata of a token is changed. 12 | /// So that the third-party platforms such as NFT market could 13 | /// timely update the images and related attributes of the NFT. 14 | event MetadataUpdate(uint256 _tokenId); 15 | 16 | /// @dev This event emits when the metadata of a range of tokens is changed. 17 | /// So that the third-party platforms such as NFT market could 18 | /// timely update the images and related attributes of the NFTs. 19 | event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId); 20 | } 21 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/vendor/arbitrum/IDelayedMessageProvider.sol: -------------------------------------------------------------------------------- 1 | // Copyright 2021-2022, Offchain Labs, Inc. 2 | // For license information, see https://github.com/nitro/blob/master/LICENSE 3 | // SPDX-License-Identifier: BUSL-1.1 4 | // OpenZeppelin Contracts (last updated v4.8.0) (vendor/arbitrum/IDelayedMessageProvider.sol) 5 | 6 | // solhint-disable-next-line compiler-version 7 | pragma solidity >=0.6.9 <0.9.0; 8 | 9 | interface IDelayedMessageProvider { 10 | /// @dev event emitted when a inbox message is added to the Bridge's delayed accumulator 11 | event InboxMessageDelivered(uint256 indexed messageNum, bytes data); 12 | 13 | /// @dev event emitted when a inbox message is added to the Bridge's delayed accumulator 14 | /// same as InboxMessageDelivered but the batch data is available in tx.input 15 | event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum); 16 | } 17 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/test/invariants/Uint256Set.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later 2 | pragma solidity 0.8.24; 3 | 4 | struct Uint256Set { 5 | uint256[] vals; 6 | mapping(uint256 => bool) saved; 7 | } 8 | 9 | library LibUint256Set { 10 | function add(Uint256Set storage s, uint256 val) internal { 11 | if (!s.saved[val]) { 12 | s.vals.push(val); 13 | s.saved[val] = true; 14 | } 15 | } 16 | 17 | function contains(Uint256Set storage s, uint256 val) internal view returns (bool) { 18 | return s.saved[val]; 19 | } 20 | 21 | function count(Uint256Set storage s) internal view returns (uint256) { 22 | return s.vals.length; 23 | } 24 | 25 | function rand(Uint256Set storage s, uint256 seed) internal view returns (uint256) { 26 | if (s.vals.length > 0) { 27 | return s.vals[seed % s.vals.length]; 28 | } else { 29 | return 0; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC721.sol"; 7 | 8 | /** 9 | * @title ERC-721 Non-Fungible Token Standard, optional metadata extension 10 | * @dev See https://eips.ethereum.org/EIPS/eip-721 11 | */ 12 | interface IERC721Metadata is IERC721 { 13 | /** 14 | * @dev Returns the token collection name. 15 | */ 16 | function name() external view returns (string memory); 17 | 18 | /** 19 | * @dev Returns the token collection symbol. 20 | */ 21 | function symbol() external view returns (string memory); 22 | 23 | /** 24 | * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. 25 | */ 26 | function tokenURI(uint256 tokenId) external view returns (string memory); 27 | } 28 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/governance/extensions/IGovernorTimelock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (governance/extensions/IGovernorTimelock.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IGovernor.sol"; 7 | 8 | /** 9 | * @dev Extension of the {IGovernor} for timelock supporting modules. 10 | * 11 | * _Available since v4.3._ 12 | */ 13 | abstract contract IGovernorTimelock is IGovernor { 14 | event ProposalQueued(uint256 proposalId, uint256 eta); 15 | 16 | function timelock() public view virtual returns (address); 17 | 18 | function proposalEta(uint256 proposalId) public view virtual returns (uint256); 19 | 20 | function queue( 21 | address[] memory targets, 22 | uint256[] memory values, 23 | bytes[] memory calldatas, 24 | bytes32 descriptionHash 25 | ) public virtual returns (uint256 proposalId); 26 | } 27 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/src/interfaces/ITokenMasterFactory.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: LicenseRef-PolyForm-Strict-1.0.0 2 | pragma solidity 0.8.24; 3 | 4 | import "../DataTypes.sol"; 5 | 6 | /** 7 | * @title ITokenMasterFactory 8 | * @author Limit Break, Inc. 9 | * @notice Interface that must be implemented by contracts that are factories 10 | * @notice for tokens that will be deployed through TokenMasterRouter. 11 | */ 12 | interface ITokenMasterFactory { 13 | function deployToken( 14 | bytes32 tokenSalt, 15 | PoolDeploymentParameters calldata poolParams, 16 | uint256 pairedValueIn, 17 | uint256 infrastructureFeeBPS 18 | ) external returns(address deployedAddress); 19 | 20 | function computeDeploymentAddress( 21 | bytes32 tokenSalt, 22 | PoolDeploymentParameters calldata poolParams, 23 | uint256 pairedValueIn, 24 | uint256 infrastructureFeeBPS 25 | ) external view returns(address deploymentAddress); 26 | } -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/mocks/ERC2771ContextMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.9; 4 | 5 | import "./ContextMock.sol"; 6 | import "../metatx/ERC2771Context.sol"; 7 | 8 | // By inheriting from ERC2771Context, Context's internal functions are overridden automatically 9 | contract ERC2771ContextMock is ContextMock, ERC2771Context { 10 | /// @custom:oz-upgrades-unsafe-allow constructor 11 | constructor(address trustedForwarder) ERC2771Context(trustedForwarder) { 12 | emit Sender(_msgSender()); // _msgSender() should be accessible during construction 13 | } 14 | 15 | function _msgSender() internal view override(Context, ERC2771Context) returns (address) { 16 | return ERC2771Context._msgSender(); 17 | } 18 | 19 | function _msgData() internal view override(Context, ERC2771Context) returns (bytes calldata) { 20 | return ERC2771Context._msgData(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/TrustedForwarder/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Burnable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Burnable.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../ERC721.sol"; 7 | import "../../../utils/Context.sol"; 8 | 9 | /** 10 | * @title ERC721 Burnable Token 11 | * @dev ERC721 Token that can be burned (destroyed). 12 | */ 13 | abstract contract ERC721Burnable is Context, ERC721 { 14 | /** 15 | * @dev Burns `tokenId`. See {ERC721-_burn}. 16 | * 17 | * Requirements: 18 | * 19 | * - The caller must own `tokenId` or be an approved operator. 20 | */ 21 | function burn(uint256 tokenId) public virtual { 22 | //solhint-disable-next-line max-line-length 23 | require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); 24 | _burn(tokenId); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC721/utils/ERC721Holder.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/utils/ERC721Holder.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC721Receiver.sol"; 7 | 8 | /** 9 | * @dev Implementation of the {IERC721Receiver} interface. 10 | * 11 | * Accepts all token transfers. 12 | * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. 13 | */ 14 | contract ERC721Holder is IERC721Receiver { 15 | /** 16 | * @dev See {IERC721Receiver-onERC721Received}. 17 | * 18 | * Always returns `IERC721Receiver.onERC721Received.selector`. 19 | */ 20 | function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { 21 | return this.onERC721Received.selector; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/utils/Multicall.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (utils/Multicall.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "./Address.sol"; 7 | 8 | /** 9 | * @dev Provides a function to batch together multiple calls in a single external call. 10 | * 11 | * _Available since v4.1._ 12 | */ 13 | abstract contract Multicall { 14 | /** 15 | * @dev Receives and executes a batch of function calls on this contract. 16 | * @custom:oz-upgrades-unsafe-allow-reachable delegatecall 17 | */ 18 | function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) { 19 | results = new bytes[](data.length); 20 | for (uint256 i = 0; i < data.length; i++) { 21 | results[i] = Address.functionDelegateCall(address(this), data[i]); 22 | } 23 | return results; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/interfaces/IERC4906.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC4906.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "./IERC165.sol"; 7 | import "./IERC721.sol"; 8 | 9 | /// @title EIP-721 Metadata Update Extension 10 | interface IERC4906 is IERC165, IERC721 { 11 | /// @dev This event emits when the metadata of a token is changed. 12 | /// So that the third-party platforms such as NFT market could 13 | /// timely update the images and related attributes of the NFT. 14 | event MetadataUpdate(uint256 _tokenId); 15 | 16 | /// @dev This event emits when the metadata of a range of tokens is changed. 17 | /// So that the third-party platforms such as NFT market could 18 | /// timely update the images and related attributes of the NFTs. 19 | event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId); 20 | } 21 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/access/README.adoc: -------------------------------------------------------------------------------- 1 | = Access Control 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/access 5 | 6 | This directory provides ways to restrict who can access the functions of a contract or when they can do it. 7 | 8 | - {AccessControl} provides a general role based access control mechanism. Multiple hierarchical roles can be created and assigned each to multiple accounts. 9 | - {Ownable} is a simpler mechanism with a single owner "role" that can be assigned to a single account. This simpler mechanism can be useful for quick tests but projects with production concerns are likely to outgrow it. 10 | 11 | == Authorization 12 | 13 | {{Ownable}} 14 | 15 | {{Ownable2Step}} 16 | 17 | {{IAccessControl}} 18 | 19 | {{AccessControl}} 20 | 21 | {{AccessControlCrossChain}} 22 | 23 | {{IAccessControlEnumerable}} 24 | 25 | {{AccessControlEnumerable}} 26 | 27 | {{AccessControlDefaultAdminRules}} 28 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@openzeppelin/contracts", 3 | "description": "Secure Smart Contract library for Solidity", 4 | "version": "4.9.3", 5 | "files": [ 6 | "**/*.sol", 7 | "/build/contracts/*.json", 8 | "!/mocks/**/*" 9 | ], 10 | "scripts": { 11 | "prepare": "bash ../scripts/prepare-contracts-package.sh", 12 | "prepare-docs": "cd ..; npm run prepare-docs" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/OpenZeppelin/openzeppelin-contracts.git" 17 | }, 18 | "keywords": [ 19 | "solidity", 20 | "ethereum", 21 | "smart", 22 | "contracts", 23 | "security", 24 | "zeppelin" 25 | ], 26 | "author": "OpenZeppelin Community ", 27 | "license": "MIT", 28 | "bugs": { 29 | "url": "https://github.com/OpenZeppelin/openzeppelin-contracts/issues" 30 | }, 31 | "homepage": "https://openzeppelin.com/contracts/" 32 | } 33 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC721.sol"; 7 | 8 | /** 9 | * @title ERC-721 Non-Fungible Token Standard, optional metadata extension 10 | * @dev See https://eips.ethereum.org/EIPS/eip-721 11 | */ 12 | interface IERC721Metadata is IERC721 { 13 | /** 14 | * @dev Returns the token collection name. 15 | */ 16 | function name() external view returns (string memory); 17 | 18 | /** 19 | * @dev Returns the token collection symbol. 20 | */ 21 | function symbol() external view returns (string memory); 22 | 23 | /** 24 | * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. 25 | */ 26 | function tokenURI(uint256 tokenId) external view returns (string memory); 27 | } 28 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/PermitC/lib/openzeppelin-contracts/contracts/utils/Context.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Provides information about the current execution context, including the 8 | * sender of the transaction and its data. While these are generally available 9 | * via msg.sender and msg.data, they should not be accessed in such a direct 10 | * manner, since when dealing with meta-transactions the account sending and 11 | * paying for execution may not be the actual sender (as far as an application 12 | * is concerned). 13 | * 14 | * This contract is only required for intermediate, library-like contracts. 15 | */ 16 | abstract contract Context { 17 | function _msgSender() internal view virtual returns (address) { 18 | return msg.sender; 19 | } 20 | 21 | function _msgData() internal view virtual returns (bytes calldata) { 22 | return msg.data; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/tm-tokenmaster/lib/creator-token-transfer-validator/lib/PermitC/lib/openzeppelin-contracts/contracts/mocks/ERC2771ContextMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.9; 4 | 5 | import "./ContextMock.sol"; 6 | import "../metatx/ERC2771Context.sol"; 7 | 8 | // By inheriting from ERC2771Context, Context's internal functions are overridden automatically 9 | contract ERC2771ContextMock is ContextMock, ERC2771Context { 10 | /// @custom:oz-upgrades-unsafe-allow constructor 11 | constructor(address trustedForwarder) ERC2771Context(trustedForwarder) { 12 | emit Sender(_msgSender()); // _msgSender() should be accessible during construction 13 | } 14 | 15 | function _msgSender() internal view override(Context, ERC2771Context) returns (address) { 16 | return ERC2771Context._msgSender(); 17 | } 18 | 19 | function _msgData() internal view override(Context, ERC2771Context) returns (bytes calldata) { 20 | return ERC2771Context._msgData(); 21 | } 22 | } 23 | --------------------------------------------------------------------------------