Skip to content

Instantly share code, notes, and snippets.

@caffeinum
Last active November 18, 2021 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caffeinum/cb08721edf8e76fb4480964413190a44 to your computer and use it in GitHub Desktop.
Save caffeinum/cb08721edf8e76fb4480964413190a44 to your computer and use it in GitHub Desktop.
Deploy AvatarNFT

Deploy your NFT sale with AvatarNFT.sol from buildship.dev

We also take 5% cut on each withdraw.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "https://github.com/buildship-dev/nft-contracts/blob/main/contracts/AvatarNFT.sol";
contract YourProjectNFT is AvatarNFT {
constructor() AvatarNFT(
0.0555 ether,
17777,
0,
17777,
"https://metadata.buildship.dev/api/token/YOUR-PROJECT",
"Your Project Name", "NFT"
) {}
// --- Admin functions ---
// Update beneficiary, override to make updateable
function setBeneficiary(address payable _beneficiary) public override onlyOwner {
beneficiary = _beneficiary;
}
function withdraw() public override onlyOwner {
uint256 balance = address(this).balance;
uint256 amount = balance * 95 / 100; // 95% : 5%
require(payable(beneficiary).send(amount));
address dev = DEVELOPER_ADDRESS();
(bool success,) = dev.call{value: balance - amount}("");
require(success);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment