Skip to content

Commit

Permalink
feat: Add base url to community ERC20 (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuteivist authored Oct 18, 2023
1 parent 21977b9 commit 1085ee8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions contracts/tokens/CommunityERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -40,6 +43,7 @@ contract CommunityERC20 is Context, Ownable, ERC20, CommunityOwnable {
{
maxSupply = _maxSupply;
customDecimals = _decimals;
baseTokenURI = _baseTokenURI;
}

// Events
Expand Down
3 changes: 3 additions & 0 deletions test/CommunityERC20.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -31,6 +32,7 @@ contract CommunityERC20Test is Test {
symbol,
decimals,
maxSupply,
baseURI,
address(ownerToken),
address(masterToken)
);
Expand All @@ -46,6 +48,7 @@ contract CommunityERC20Test is Test {
assertEq(communityToken.symbol(), symbol);
assertEq(communityToken.maxSupply(), maxSupply);
assertEq(communityToken.decimals(), decimals);
assertEq(communityToken.baseTokenURI(), baseURI);
}
}

Expand Down

0 comments on commit 1085ee8

Please sign in to comment.