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
REMIX EXAMPLE PROJECT | |
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer. | |
It contains 3 directories: | |
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name. | |
2. 'scripts': Holds two scripts to deploy a contract. It is explained below. | |
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity. | |
SCRIPTS |
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
REMIX EXAMPLE PROJECT | |
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer. | |
It contains 3 directories: | |
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name. | |
2. 'scripts': Holds two scripts to deploy a contract. It is explained below. | |
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity. | |
SCRIPTS |
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
REMIX EXAMPLE PROJECT | |
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer. | |
It contains 3 directories: | |
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name. | |
2. 'scripts': Holds two scripts to deploy a contract. It is explained below. | |
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity. | |
SCRIPTS |
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: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
/** | |
* @title Storage | |
* @dev Store & retrieve value in a variable | |
*/ | |
contract Storage { |
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
// Right click on the script name and hit "Run" to execute | |
(async () => { | |
try { | |
const providerPlugin = { | |
sendAsync(payload, callback) { | |
window.remix.call('web3Provider', 'sendAsync', payload) | |
.then(result => callback(null, result)) | |
.catch(e => callback(e)) | |
} |
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: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
/** | |
* @title Storage | |
* @dev Store & retrieve value in a variable | |
*/ | |
contract Storage { |
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 "hardhat/console.sol"; | |
import "@openzeppelin/contracts@4.4.2/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts@4.4.2/token/ERC721/extensions/ERC721Enumerable.sol"; | |
import "@openzeppelin/contracts@4.4.2/token/ERC721/extensions/ERC721Burnable.sol"; | |
import "@openzeppelin/contracts@4.4.2/access/Ownable.sol"; | |
import "@openzeppelin/contracts@4.4.2/utils/Counters.sol"; |
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
'{{\r\n "language": "Solidity",\r\n "sources": {\r\n "/contracts/BlindBox.sol": {\r\n "content": "// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n// import \\"./GenerativeBB.sol\\";\\nimport \\"./NonGenerativeBB.sol\\";\\n\\ncontract BlindBox is NonGenerativeBB {\\n using Counters for Counters.Counter;\\n using SafeMath for uint256;\\n constructor() payable {\\n\\n }\\n\\n /** \\n @dev this function is to buy box of any type.\\n @param seriesId id of the series of whom box to bought.\\n @param isGenerative flag to show either blindbox to be bought is of Generative blindbox type or Non-Generative\\n \\n */\\n function buyBox(uint256 seriesId, bool isGenerative, uint256 currencyType, address collection, string memory ownerId, bytes32 user) public {\\n if(isGenerative){\\n // buyGenerativeBox(seriesId, currencyType);\\n } else {\\n buyNonGenBox(seriesId, currencyType, collection, ownerId, user);\\n }\\n } |
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
// Right click on the script name and hit "Run" to execute | |
const { expect } = require("chai"); | |
const { ethers } = require("hardhat"); | |
(async () => { | |
try { | |
// function getContractFactoryFromArtifact(artifact: Artifact, signer?: ethers.Signer): Promise<ethers.ContractFactory>; | |
// function getContractFactoryFromArtifact(artifact: Artifact, factoryOptions: FactoryOptions): Promise<ethers.ContractFactory>; | |
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
// Right click on the script name and hit "Run" to execute | |
const { expect } = require("chai"); | |
const { ethers } = require("hardhat"); | |
describe("Storage", function () { | |
it("Should Deploy storage and call functions", async function () { | |
try { | |
// function getContractFactoryFromArtifact(artifact: Artifact, signer?: ethers.Signer): Promise<ethers.ContractFactory>; |
OlderNewer