feat: Add base url to community ERC20 (#21)

This commit is contained in:
Cuteivist 2023-10-18 12:12:29 +02:00 committed by GitHub
parent 21977b99f6
commit 1085ee8308
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 12 deletions

View File

@ -3,15 +3,15 @@ AddEntryTest:test_RevertWhen_EntryAlreadyExists() (gas: 42644)
AddEntryTest:test_RevertWhen_InvalidAddress() (gas: 25133)
AddEntryTest:test_RevertWhen_SenderIsNotTokenDeployer() (gas: 14827)
CollectibleV1Test:test_Deployment() (gas: 36386)
CommunityERC20Test:test_Deployment() (gas: 27659)
CommunityERC20Test:test_Deployment() (gas: 35198)
CommunityTokenDeployerTest:test_Deployment() (gas: 14805)
CreateTest:test_Create() (gas: 2269916)
CreateTest:test_Create() (gas: 2568994)
CreateTest:test_RevertWhen_InvalidOwnerTokenAddress() (gas: 15523)
CreateTest:test_RevertWhen_InvalidReceiverAddress() (gas: 15656)
CreateTest:test_RevertWhen_InvalidSignerPublicKey() (gas: 17057)
CreateTest:test_RevertWhen_InvalidTokenMetadata() (gas: 27936)
CreateTest:test_RevertWhen_InvalidTokenMetadata() (gas: 28173)
CreateTest:test_RevertWhen_InvalidTokenMetadata() (gas: 29940)
CreateTest:test_RevertWhen_InvalidTokenMetadata() (gas: 30179)
CreateTest:test_RevertWhen_SenderIsNotTokenDeployer() (gas: 16421)
CreateTest:test_RevertWhen_SenderIsNotTokenDeployer() (gas: 16524)
DeployContracts:test() (gas: 120)
@ -23,20 +23,20 @@ DeployTest:test_RevertWhen_InvalidCommunityAddress() (gas: 51385)
DeployTest:test_RevertWhen_InvalidDeployerAddress() (gas: 55272)
DeployTest:test_RevertWhen_InvalidDeploymentSignature() (gas: 65617)
DeployTest:test_RevertWhen_InvalidSignerPublicKey() (gas: 53433)
DeployTest:test_RevertWhen_InvalidTokenMetadata() (gas: 2692510)
DeployTest:test_RevertWhen_InvalidTokenMetadata() (gas: 2694728)
DeploymentTest:test_Deployment() (gas: 14671)
DeploymentTest:test_Deployment() (gas: 14671)
DeploymentTest:test_Deployment() (gas: 17295)
GetEntryTest:test_ReturnZeroAddressIfEntryDoesNotExist() (gas: 11906)
MintToTest:test_Deployment() (gas: 27681)
MintToTest:test_Deployment() (gas: 35220)
MintToTest:test_Deployment() (gas: 36386)
MintToTest:test_Deployment() (gas: 83220)
MintToTest:test_MintTo() (gas: 178173)
MintToTest:test_MintTo() (gas: 178063)
MintToTest:test_MintTo() (gas: 526242)
MintToTest:test_RevertWhen_AddressesAndAmountsAreNotEqualLength() (gas: 29695)
MintToTest:test_RevertWhen_AddressesAndAmountsAreNotEqualLength() (gas: 29673)
MintToTest:test_RevertWhen_MaxSupplyIsReached() (gas: 20653)
MintToTest:test_RevertWhen_MaxSupplyIsReached() (gas: 511039)
MintToTest:test_RevertWhen_MaxSupplyReached() (gas: 134821)
MintToTest:test_RevertWhen_MaxSupplyReached() (gas: 134799)
MintToTest:test_RevertWhen_SenderIsNotOwner() (gas: 31544)
OwnerTokenTest:test_Deployment() (gas: 83220)
RemoteBurnTest:test_Deployment() (gas: 36386)
@ -55,13 +55,13 @@ SetMasterTokenFactoryAddressTest:test_Deployment() (gas: 14805)
SetMasterTokenFactoryAddressTest:test_RevertWhen_InvalidTokenFactoryAddress() (gas: 12992)
SetMasterTokenFactoryAddressTest:test_RevertWhen_SenderIsNotOwner() (gas: 12465)
SetMasterTokenFactoryAddressTest:test_SetOwnerTokenFactoryAddress() (gas: 22861)
SetMaxSupplyTest:test_Deployment() (gas: 27659)
SetMaxSupplyTest:test_Deployment() (gas: 35198)
SetMaxSupplyTest:test_Deployment() (gas: 83242)
SetMaxSupplyTest:test_RevertWhen_CalledBecauseMaxSupplyIsLocked() (gas: 14327)
SetMaxSupplyTest:test_RevertWhen_MaxSupplyLowerThanTotalSupply() (gas: 163620)
SetMaxSupplyTest:test_RevertWhen_MaxSupplyLowerThanTotalSupply() (gas: 163641)
SetMaxSupplyTest:test_RevertWhen_SenderIsNotOwner() (gas: 12527)
SetMaxSupplyTest:test_RevertWhen_SenderIsNotOwner() (gas: 21402)
SetMaxSupplyTest:test_SetMaxSupply() (gas: 23955)
SetMaxSupplyTest:test_RevertWhen_SenderIsNotOwner() (gas: 21445)
SetMaxSupplyTest:test_SetMaxSupply() (gas: 23998)
SetOwnerTokenFactoryAddressTest:test_Deployment() (gas: 14805)
SetOwnerTokenFactoryAddressTest:test_RevertWhen_InvalidTokenFactoryAddress() (gas: 12970)
SetOwnerTokenFactoryAddressTest:test_RevertWhen_SenderIsNotOwner() (gas: 12443)

View File

@ -27,11 +27,14 @@ contract CommunityERC20 is Context, Ownable, ERC20, CommunityOwnable {
uint8 private immutable customDecimals;
string public baseTokenURI;
constructor(
string memory _name,
string memory _symbol,
uint8 _decimals,
uint256 _maxSupply,
string memory _baseTokenURI,
address _ownerToken,
address _masterToken
)
@ -40,6 +43,7 @@ contract CommunityERC20 is Context, Ownable, ERC20, CommunityOwnable {
{
maxSupply = _maxSupply;
customDecimals = _decimals;
baseTokenURI = _baseTokenURI;
}
// Events

View File

@ -17,6 +17,7 @@ contract CommunityERC20Test is Test {
string internal name = "Test";
string internal symbol = "TEST";
string internal baseURI = "http://local.dev";
uint256 internal maxSupply = 100;
uint8 internal decimals = 18;
@ -31,6 +32,7 @@ contract CommunityERC20Test is Test {
symbol,
decimals,
maxSupply,
baseURI,
address(ownerToken),
address(masterToken)
);
@ -46,6 +48,7 @@ contract CommunityERC20Test is Test {
assertEq(communityToken.symbol(), symbol);
assertEq(communityToken.maxSupply(), maxSupply);
assertEq(communityToken.decimals(), decimals);
assertEq(communityToken.baseTokenURI(), baseURI);
}
}