Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

add a watermark to the token name #47

Merged
merged 4 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/token/ERC20Token.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ contract ERC20Token is ERC20, ERC20Burnable {
string memory name,
string memory symbol,
uint256 initialAmount
) ERC20(name, symbol) {
) ERC20(string(abi.encodePacked(name, " Party")), symbol) {
_mint(msg.sender, initialAmount);
}
}
13 changes: 11 additions & 2 deletions test/BNBPartyFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,16 @@ describe("BNBPartyFactory", function () {
expect(await BNBPositionManager.totalSupply()).to.equal(1)
})

it("should create a token with a name ending with ' Party'", async function () {
const tx = await bnbPartyFactory.createParty(name, symbol, { value: tokenCreationFee })
await tx.wait()
const events = await bnbPartyFactory.queryFilter(bnbPartyFactory.filters["StartParty(address,address,address)"])
const tokenAddress = events[events.length - 1].args.tokenAddress
const token = await ethers.getContractAt("ERC20Token", tokenAddress)
expect(await token.name()).to.equal(name + " Party")
expect(await token.symbol()).to.equal(symbol)
})

it("bnb-party is owner of the party LP", async () => {
await bnbPartyFactory.createParty(name, symbol, { value: tokenCreationFee })
const tokenId = (await BNBPositionManager.totalSupply()) - 1n
Expand Down Expand Up @@ -530,8 +540,7 @@ describe("BNBPartyFactory", function () {
? await lpPool.feeGrowthGlobal1X128()
: await lpPool.feeGrowthGlobal0X128()
const collectedFee = await bnbPartyFactory.getFeeGrowthInsideLastX128(lpAddress)
console.log(collectedFee.feeGrowthInside0LastX128)
expect(await bnbPartyFactory.calculateFees(liquidity, feeGrowthGlobalX128 - collectedFee.feeGrowthInside0LastX128)).to.be.equal(0)
expect(await bnbPartyFactory.calculateFees(liquidity, feeGrowthGlobalX128 - collectedFee.feeGrowthInside1LastX128)).to.be.equal(0)
})

it("should revert zero lenght array", async () => {
Expand Down