We also take 5% cut on each withdraw.
Last active
November 18, 2021 04:29
-
-
Save caffeinum/cb08721edf8e76fb4480964413190a44 to your computer and use it in GitHub Desktop.
Deploy AvatarNFT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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