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
async function check(req, res) { | |
const walletInfo = req.body.walletInfo as Wallet | |
if (!walletInfo?.connectItems?.tonProof) { | |
return res.status(httpStatus.BAD_REQUEST).send({ ok: false }) | |
} | |
const proof = walletInfo.connectItems.tonProof as TonProofItemReplySuccess | |
if (!proof) { | |
return res.status(httpStatus.BAD_REQUEST).send({ ok: false }) | |
} | |
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
pragma solidity >=0.4.2 <0.6.0; | |
contract Ballot { | |
struct Voter { | |
uint weight; | |
bool voted; | |
uint vote; | |
} | |
mapping(address => Voter) voters; |
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 for the 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: MIT | |
// OpenZeppelin Contracts v4.4.0 (token/ERC20/ERC20.sol) | |
pragma solidity ^0.8.0; | |
import "./IERC20.sol"; | |
import "./extensions/IERC20Metadata.sol"; | |
import "../../utils/Context.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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.7.1; | |
contract StudentScore { | |
mapping (string => uint) scores; | |
string[] names; | |
function addScore(string memory name, uint256 score) public { | |
scores[name] = score; // mapping declare |
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
function pullJSON() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getSheetByName("TVL_Protocol"); | |
var url = "https://api.llama.fi/protocols"; // Paste your JSON URL here | |
var response = UrlFetchApp.fetch(url); // get feed | |
var dataAll = JSON.parse(response.getContentText()); // | |
var dataSet = dataAll; | |
const dt = new Date() |