Skip to content

Instantly share code, notes, and snippets.

contract Quantumon is ERC721, RrpRequesterV0, Ownable {
using Strings for uint256;
uint256[9958] public ids; //Array to store the Quantomon Id - This is different from the tokenId
uint256 private index; // Track the next TokenId to be minted
string private _baseURIextended; // The Extended baseUrl for ERC721
mapping(uint256 => string) private _tokenURIs; //Mapping a custom URI to a tokenId
address public airnode; //The address of the QRNG airnode
//SPDX-License-Identifier: MIT
pragma solidity 0.8.14;
import "@api3/airnode-protocol/contracts/rrp/requesters/RrpRequesterV0.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract Quantumon is ERC721, RrpRequesterV0, Ownable {
}
@Ashar2shahid
Ashar2shahid / RandomCharacter.sol
Created June 30, 2022 04:24
The contract we deployed during the workshop on June-28-2022. It uses QRNG to mint a random character and set its attributes
//SPDX-License-Identifier: MIT
pragma solidity 0.8.14;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@api3/airnode-protocol/contracts/rrp/requesters/RrpRequesterV0.sol";
contract RandomCharacter is ERC721, Ownable, RrpRequesterV0 {
struct Character{
uint256 strenght;
uint256 intelligence;
contract Quantumon is ERC721, RrpRequesterV0, Ownable {
using Strings for uint256;
uint256[9958] public ids; //Array to store the Quantomon Id - This is different from the tokenId
uint256 private index; // Track the next TokenId to be minted
string private _baseURIextended; // The Extended baseUrl for ERC721
mapping(uint256 => string) private _tokenURIs; //Mapping a custom URI to a tokenId
address public airnode; //The address of the QRNG airnode
contract Quantumon is ERC721, RrpRequesterV0, Ownable {
using Strings for uint256;
uint256[9958] public ids; //Array to store the Quantomon Id - This is different from the tokenId
uint256 private index; // Track the next TokenId to be minted
string private _baseURIextended; // The Extended baseUrl for ERC721
mapping(uint256 => string) private _tokenURIs; //Mapping a custom URI to a tokenId
address public airnode; //The address of the QRNG airnode
@Ashar2shahid
Ashar2shahid / Quantumon.sol
Created July 1, 2022 08:55
The Complete Contract
contract Quantumon is ERC721, RrpRequesterV0, Ownable {
using Strings for uint256;
uint256[9958] public ids; //Array to store the Quantomon Id - This is different from the tokenId
uint256 private index; // Track the next TokenId to be minted
string private _baseURIextended; // The Extended baseUrl for ERC721
mapping(uint256 => string) private _tokenURIs; //Mapping a custom URI to a tokenId
address public airnode; //The address of the QRNG airnode
function generateQuantumon(bytes32 requestId, bytes calldata data)
public
onlyAirnodeRrp
{
require(
expectingRequestWithIdToBeFulfilled[requestId],
"Request ID not known"
);
expectingRequestWithIdToBeFulfilled[requestId] = false;
uint256 qrngUint256 = abi.decode(data, (uint256));
//SPDX-License-Identifier: MIT
pragma solidity 0.8.14;
contract Arbitration {
address public arbitor;
address public userA;
address public userB;
constructor() {
//SPDX-License-Identifier: MIT
pragma solidity 0.8.14;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract DemoNFT is Ownable, ERC721 {
constructor() ERC721("Demo Day", "DD") {}
uint256 public index;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@api3/airnode-protocol-v1/contracts/dapis/DapiReader.sol";
contract DataFeedReaderExample is DapiReader {
constructor(address _dapiServer) DapiReader(_dapiServer) {}