-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚁🐊 ↣ Adding contract info for #6 to frontend, allow contract interact…
…ivity in #16
- Loading branch information
1 parent
74ec010
commit 03854d5
Showing
11 changed files
with
778 additions
and
105 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,4 @@ venv | |
cache | ||
/cache | ||
./cache | ||
.cache | ||
.cache.gitsigners |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.0; | ||
|
||
import "@thirdweb-dev/contracts/base/ERC1155LazyMint.sol"; | ||
|
||
contract SpaceshipContract is ERC1155LazyMint { | ||
constructor( | ||
string memory _name, | ||
string memory _symbol | ||
) ERC1155LazyMint(_name, _symbol, msg.sender, 0) {} | ||
|
||
function burn ( address _owner, uint256 _tokenId, uint256 _amount ) external override { | ||
address caller = msg.sender; | ||
|
||
require(caller == _owner || isApprovedForAll[_owner][caller], "Unapproved caller"); | ||
require(balanceOf[_owner][_tokenId] >= _amount, "Not enough tokens owned"); | ||
|
||
_burn(_owner, _tokenId, _amount); | ||
if (_tokenId == 0) { | ||
_mint(_owner, 1, _amount, ""); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** @type import('hardhat/config').HardhatUserConfig */ | ||
module.exports = { | ||
solidity: { | ||
version: '0.8.9', | ||
settings: { | ||
optimizer: { | ||
enabled: true, | ||
runs: 200, | ||
}, | ||
}, | ||
}, | ||
}; |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from thirdweb import ThirdwebSDK | ||
import requests | ||
from flask import Blueprint | ||
|
||
# Talking to Moralis | ||
def requestEVM(): | ||
url = "https://authapi.moralis.io/challenge/request/evm" | ||
payload = {"timeout": 15} | ||
headers = { | ||
"accept": "application/json", | ||
"content-type": "application/json", | ||
"X-API-KEY": "kJfYYpmMmfKhvaWMdD3f3xMMb24B4MHBDDVrfjslkKgTilvMgdwr1bwKUr8vWdHH" | ||
} | ||
|
||
response = requests.post(url, json=payload, headers=headers) | ||
|
||
sdk = ThirdwebSDK("mumbai") # Connect to the mumbai testnet on EVM | ||
contract = sdk.get_contract("0xed6e837Fda815FBf78E8E7266482c5Be80bC4bF9") | ||
data = contract.call("claim", _receiver, _tokenId, _quantity) |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from "react"; | ||
|
||
export const Unitydb = () => { | ||
return ( | ||
<div> | ||
<p>Hello</p> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.