Skip to content

Commit

Permalink
MOD: nft min price
Browse files Browse the repository at this point in the history
  • Loading branch information
cctv2206 committed Apr 12, 2024
1 parent c17a2c1 commit f9167be
Show file tree
Hide file tree
Showing 3 changed files with 735 additions and 67 deletions.
21 changes: 15 additions & 6 deletions contracts/aime/AIMeFactoryV4.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ contract AIMeFactoryV4 is Ownable {
protocolFee = _protocolFee;
}

function createAIME(
function createAIMeVerified(
string memory name_,
string memory avatar_,
string memory bio_,
string memory image_,
string memory socialKey_,
string memory socialId_,
uint256 minPrice_,
uint256 priceIncrement_,
address aimePowerAddress,
bytes memory signature
Expand All @@ -45,11 +46,14 @@ contract AIMeFactoryV4 is Ownable {
avatar_,
bio_,
image_,
socialKey_,
socialId_,
priceIncrement_,
aimePowerAddress,
addressNonce[msg.sender]
abi.encodePacked(
socialKey_,
socialId_,
minPrice_,
priceIncrement_,
aimePowerAddress,
addressNonce[msg.sender]
)
)
)
);
Expand All @@ -64,6 +68,7 @@ contract AIMeFactoryV4 is Ownable {
avatar_,
bio_,
image_,
minPrice_,
priceIncrement_,
protocolSigner,
aimePowerAddress
Expand All @@ -86,6 +91,7 @@ contract AIMeFactoryV4 is Ownable {
string memory avatar_,
string memory bio_,
string memory image_,
uint256 minPrice_,
uint256 priceIncrement_,
address aimeSigner,
address aimePowerAddress
Expand All @@ -95,6 +101,7 @@ contract AIMeFactoryV4 is Ownable {
avatar_,
bio_,
image_,
minPrice_,
priceIncrement_,
aimeSigner,
aimePowerAddress
Expand All @@ -106,6 +113,7 @@ contract AIMeFactoryV4 is Ownable {
string memory avatar_,
string memory bio_,
string memory image_,
uint256 minPrice_,
uint256 priceIncrement_,
address aimeSigner,
address aimePowerAddress
Expand All @@ -119,6 +127,7 @@ contract AIMeFactoryV4 is Ownable {
avatar_,
bio_,
image_,
minPrice_,
priceIncrement_,
aimePowerAddress
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,67 +246,67 @@ describe("AimePowerFairLaunchV2", () => {
// });
// });

describe("launch start", () => {
it("can start after all minted", async () => {
await signer2.sendTransaction({
to: aimePowerFairLaunchV2.address,
value: price.mul(3),
});

const minted = await aimePowerFairLaunchV2.minted();
const mintLimit = await aimePowerFairLaunchV2.mintLimit();
console.log("minted:", minted.toString());
expect(minted).to.be.eq(mintLimit);

const wethBalanceBefore = await wethContract.balanceOf(
aimePowerFairLaunchV2.address
);
console.log("weth balance before:", wethBalanceBefore.toString());

const powerBalanceBefore = await aimePowerFairLaunchV2.balanceOf(
aimePowerFairLaunchV2.address
);
console.log("power balance before:", powerBalanceBefore.toString());

const ethBalanceBefore = await ethers.provider.getBalance(
aimePowerFairLaunchV2.address
);
console.log("eth balance before:", ethBalanceBefore.toString());

// transfer 0 value?
const tx = await signer2.sendTransaction({
to: aimePowerFairLaunchV2.address,
value: 0,
});
await tx.wait();

const started = await aimePowerFairLaunchV2.started();
expect(started).to.be.eq(true);

const wethBalance = await wethContract.balanceOf(
aimePowerFairLaunchV2.address
);
console.log("weth balance:", wethBalance.toString());

const powerBalance = await aimePowerFairLaunchV2.balanceOf(
aimePowerFairLaunchV2.address
);
console.log("power balance:", powerBalance.toString());

const ethBalance = await ethers.provider.getBalance(
aimePowerFairLaunchV2.address
);
console.log("eth balance before:", ethBalance.toString());

const pool = await aimePowerFairLaunchV2.pool();
poolContract = IUniswapV3Pool__factory.connect(pool, owner);
const tickSpacing = await poolContract.tickSpacing();
console.log("tickSpacing:", tickSpacing.toString());

const slot0 = await poolContract.slot0();
console.log("slot0:", slot0);
});
});
// describe("launch start", () => {
// it("can start after all minted", async () => {
// await signer2.sendTransaction({
// to: aimePowerFairLaunchV2.address,
// value: price.mul(3),
// });

// const minted = await aimePowerFairLaunchV2.minted();
// const mintLimit = await aimePowerFairLaunchV2.mintLimit();
// console.log("minted:", minted.toString());
// expect(minted).to.be.eq(mintLimit);

// const wethBalanceBefore = await wethContract.balanceOf(
// aimePowerFairLaunchV2.address
// );
// console.log("weth balance before:", wethBalanceBefore.toString());

// const powerBalanceBefore = await aimePowerFairLaunchV2.balanceOf(
// aimePowerFairLaunchV2.address
// );
// console.log("power balance before:", powerBalanceBefore.toString());

// const ethBalanceBefore = await ethers.provider.getBalance(
// aimePowerFairLaunchV2.address
// );
// console.log("eth balance before:", ethBalanceBefore.toString());

// // transfer 0 value?
// const tx = await signer2.sendTransaction({
// to: aimePowerFairLaunchV2.address,
// value: 0,
// });
// await tx.wait();

// const started = await aimePowerFairLaunchV2.started();
// expect(started).to.be.eq(true);

// const wethBalance = await wethContract.balanceOf(
// aimePowerFairLaunchV2.address
// );
// console.log("weth balance:", wethBalance.toString());

// const powerBalance = await aimePowerFairLaunchV2.balanceOf(
// aimePowerFairLaunchV2.address
// );
// console.log("power balance:", powerBalance.toString());

// const ethBalance = await ethers.provider.getBalance(
// aimePowerFairLaunchV2.address
// );
// console.log("eth balance before:", ethBalance.toString());

// const pool = await aimePowerFairLaunchV2.pool();
// poolContract = IUniswapV3Pool__factory.connect(pool, owner);
// const tickSpacing = await poolContract.tickSpacing();
// console.log("tickSpacing:", tickSpacing.toString());

// const slot0 = await poolContract.slot0();
// console.log("slot0:", slot0);
// });
// });

// describe("swap (after launch started)", () => {
// beforeEach("mint token and launch", async () => {
Expand Down

0 comments on commit f9167be

Please sign in to comment.