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

Culture Refi by Team wonder final submission #96

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2eae847
first changing Readme
BuildwithMc Sep 27, 2022
9dbb4cf
Create Ego NFTairdop
Anthonyslav1 Oct 7, 2022
66313af
Create Ego NFT
Anthonyslav1 Oct 7, 2022
839164f
Update Ego NFT
Anthonyslav1 Oct 7, 2022
5e661ea
Update Ego NFT
Anthonyslav1 Oct 7, 2022
3eebd8f
Update Ego NFT
Anthonyslav1 Oct 7, 2022
d4015d1
dashboard setup
BuildwithMc Oct 15, 2022
86319ee
importing bootstrap files and resources
BuildwithMc Oct 15, 2022
f4366c0
import fav icon set and cover images
BuildwithMc Oct 15, 2022
77776e3
done with fixs for signup page
BuildwithMc Oct 15, 2022
5ac08ac
added client and server
sammyyOzz Oct 30, 2022
1dbb7a0
added redux
sammyyOzz Oct 30, 2022
c5b928f
signup, login, verifying email address
sammyyOzz Oct 30, 2022
001aff2
changed main path in root package.json
sammyyOzz Oct 30, 2022
314ee6f
Update Ego NFT
Anthonyslav1 Nov 8, 2022
f3d48d1
Create Airdrop contract.sol
Anthonyslav1 Nov 8, 2022
89f64c5
Create staking contract.sol
Anthonyslav1 Nov 8, 2022
ae1e0a3
Create cowry token.sol
Anthonyslav1 Nov 8, 2022
12e2268
Create Ego NFT abi
Anthonyslav1 Nov 8, 2022
449e7da
Create cowry token abi
Anthonyslav1 Nov 8, 2022
2d2a0e6
Rename Ego NFT abi to Ego NFT abi.json
Anthonyslav1 Nov 8, 2022
c7ca417
Rename cowry token abi to cowry token abi.json
Anthonyslav1 Nov 8, 2022
87b0d63
Create stacking abi
Anthonyslav1 Nov 8, 2022
924ef2b
Rename Ego NFTairdop to Ego NFTairdop.sol
Anthonyslav1 Nov 8, 2022
4da89b0
Rename Ego NFT to Cowry nft.sol
Anthonyslav1 Nov 8, 2022
e44114f
Rename Ego NFTairdop.sol to cowry NFTairdop.sol
Anthonyslav1 Nov 8, 2022
324b8dc
Rename Ego NFT abi.json to cowry NFT abi.json
Anthonyslav1 Nov 8, 2022
e38acc2
Create contracts.readme
Anthonyslav1 Nov 14, 2022
4819c3f
Rename stacking abi to stacking abi,json
Anthonyslav1 Nov 14, 2022
3536037
Rename stacking abi,json to stacking abi.json
Anthonyslav1 Nov 14, 2022
74f12e9
Rename contracts.readme to contracts readme.md
Anthonyslav1 Nov 14, 2022
e4ed6aa
Finally update
BuildwithMc Nov 14, 2022
3eb893a
NAME UPDATE
BuildwithMc Nov 14, 2022
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
434 changes: 434 additions & 0 deletions Culture (EGO) by Team Wonder/Contracts/Airdrop contract.sol

Large diffs are not rendered by default.

165 changes: 165 additions & 0 deletions Culture (EGO) by Team Wonder/Contracts/Cowry nft.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@


// File: ado-contracts/contracts/interfaces/IERC2362.sol



pragma solidity >=0.5.0 <0.9.0;

/**
* @dev EIP2362 Interface for pull oracles
* https://github.com/adoracles/EIPs/blob/erc-2362/EIPS/eip-2362.md
*/
interface IERC2362
{
/**
* @dev Exposed function pertaining to EIP standards
* @param _id bytes32 ID of the query
* @return int,uint,uint returns the value, timestamp, and status code of query
*/
function valueFor(bytes32 _id) external view returns(int256,uint256,uint256);
}
// File: witnet-solidity-bridge/contracts/interfaces/IWitnetPriceRouter.sol


pragma solidity >=0.7.0 <0.9.0;

// SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";


contract EgoNFT is ERC721Enumerable, Ownable {

using Strings for uint256;

string baseURI;
string public baseExtension = ".json";
bool public paused = false;
bool public revealed = false;
string public notRevealedUri;
uint256 cost;
uint256 maxSupply;
uint256 maxMintAmount;

constructor (

string memory _name,
string memory _symbol,
uint256 _initialPrice,
uint256 _initialSupply,
uint256 maxntno,
string memory _initBaseURI,
string memory _initNotRevealedUri
) ERC721(_name, _symbol) {
setPrice(_initialPrice);
setmaxMintAmount(maxntno);
setSupply(_initialSupply);
setBaseURI(_initBaseURI);
setNotRevealedURI(_initNotRevealedUri);
}

// internal
function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}

// public
function mint(uint256 _mintAmount) public payable {
uint256 supply = totalSupply();
require(!paused);

require(_mintAmount >0 && _mintAmount <= maxMintAmount );

require(supply + _mintAmount <= maxSupply);

if (msg.sender != owner()) {
//require( msg.value) >= cost * _mintAmount, "not enough Celo");
}




for (uint256 i = 1; i <= _mintAmount; i++) {
_safeMint(msg.sender, supply + i);
}
}

function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
uint256 ownerTokenCount = balanceOf(_owner);
uint256[] memory tokenIds = new uint256[](ownerTokenCount);
for (uint256 i; i < ownerTokenCount; i++) {
tokenIds[i] = tokenOfOwnerByIndex(_owner, i);
}
return tokenIds;
}

function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);

if(revealed == false) {
return notRevealedUri;
}

string memory currentBaseURI = _baseURI();
return bytes(currentBaseURI).length > 0
? string(abi.encodePacked(currentBaseURI, tokenId.toString(), baseExtension))
: "";
}

//only owner
function reveal() public onlyOwner {
revealed = true;
}

function setPrice(uint256 _newPrice) public onlyOwner() {
cost = _newPrice;
}

function setSupply(uint256 _newSupply) public onlyOwner() {
maxSupply = _newSupply;
}

function getSupply() public view returns (uint256) {
return maxSupply;
}

function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner {
maxMintAmount = _newmaxMintAmount;
}

function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
notRevealedUri = _notRevealedURI;
}

function setBaseURI(string memory _newBaseURI) public onlyOwner {
baseURI = _newBaseURI;
}

function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
baseExtension = _newBaseExtension;
}

function pause(bool _state) public onlyOwner {
paused = _state;
}



}
94 changes: 94 additions & 0 deletions Culture (EGO) by Team Wonder/Contracts/cowry NFTairdop.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
pragma solidity ^0.8.7;

// SPDX-License-Identifier: MIT


import '@openzeppelin/contracts/token/ERC721/IERC721.sol';

contract EGOairdrop {

struct Airdrop {

address nft;

uint id;

}

uint public nextAirdropId;

address public admin;

mapping(uint => Airdrop) public airdrops;

mapping(address => bool) public recipients;

constructor() {

admin = msg.sender;

}

function addAirdrops(Airdrop[] memory _airdrops) external {

uint _nextAirdropId = nextAirdropId;

for(uint i = 0; i < _airdrops.length; i++) {

airdrops[_nextAirdropId] = _airdrops[i];

IERC721(_airdrops[i].nft).transferFrom(

msg.sender,

address(this),

_airdrops[i].id

);

_nextAirdropId++;

}

}

function addRecipients(address[] memory _recipients) external {

require(msg.sender == admin, 'only admin');

for(uint i = 0; i < _recipients.length; i++) {

recipients[_recipients[i]] = true;

}

}

function removeRecipients(address[] memory _recipients) external {

require(msg.sender == admin, 'only admin');

for(uint i = 0; i < _recipients.length; i++) {

recipients[_recipients[i]] = false;

}

}

function claim() external {

require(recipients[msg.sender] == true, 'recipient not registered');

recipients[msg.sender] = false;

Airdrop storage airdrop = airdrops[nextAirdropId];

IERC721(airdrop.nft).transferFrom(address(this), msg.sender, airdrop.id);

nextAirdropId++;

}

}
Loading