This file contains hidden or 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 is a simple book storage contract | |
| // where users store list of books they bookmarekd to read. | |
| // users can also delete them after acheving their goal of reading them. | |
| // similar to Todo | |
| // the legacy map used in this contract mimicks array | |
| // using the LIFO pattern (last in, first out) | |
| #[starknet::interface] |
This file contains hidden or 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
| export const projectId = "91123e3eafe4c736a115f6e3f6484a47"; | |
| export const api_keys = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweEI4OTFmNGY4NEQwNjY1MGIwOTViNWYzZjgyMUYyMUYyMTU0NjQ3MDciLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTY4NzY0NDA4MzI1OSwibmFtZSI6IlZlbmRhbyJ9.rvQvuQitUMttFWkFAW0gZZU7ohpT4UNc_Or0Bm8u0qc" |
This file contains hidden or 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
| import getContract from "./utils/getContract.js"; | |
| const { ethers: etherjs } = ethers; | |
| async function getTodoList() { | |
| const contract = getContract(); | |
| try { | |
| const response = await contract.getTodos(); | |
| const formatted = response.map((item) => { | |
| return { | |
| name: item[0], |
This file contains hidden or 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
| import abi from "./abi.js"; | |
| import openTab from "./tab.js"; | |
| const { ethers: etherjs } = ethers; | |
| const rpcUrl = "https://goerli.infura.io/v3/ba80361523fe423bb149026a490266f0"; | |
| const signerProvider = new etherjs.providers.Web3Provider(window.ethereum); | |
| const provider = new etherjs.providers.JsonRpcProvider(rpcUrl); | |
| const signer = signerProvider.getSigner(); |
This file contains hidden or 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
| uint256 constant SALARY=20000; | |
| struct Workers{ | |
| uint8 count; | |
| string name; | |
| } | |
| library Arithmetic{ | |
| function add(uint a,uint b) internal pure returns(uint){ |
This file contains hidden or 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
| import "./LibCast.sol"; | |
| contract Cast{ | |
| using Arithmetic for uint; | |
| using Arithmetic for Arithmetic.Workers; | |
| Arithmetic.Workers aw; | |
| uint tem; |
This file contains hidden or 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.8.7; | |
| contract Energy{ | |
| //have total supply | |
| //transferrable | |
| //name |
This file contains hidden or 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.7; | |
| contract DepositFund{ | |
| mapping(address=>uint) balance; | |
| function deposit() public payable{ |
This file contains hidden or 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.7; | |
| contract CountAfterSeconds{ | |
| uint public count; | |
| uint today; | |
| constructor(){ | |
| today = block.timestamp; |