show dbs
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.11; | |
contract EtherWallet{ | |
address payable public owner; | |
// Only owner can access the function and withdraw | |
constructor() { | |
owner = payable(msg.sender); | |
} |
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.10; | |
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol"; | |
contract Lottery is VRFConsumerBase{ | |
// Declare the owner | |
address public owner; | |
// Declare the Player |
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.0; | |
contract Lottery { | |
// Declare the owner | |
address public owner; | |
// Declare the Player | |
address payable[] public players; | |
uint256 public lotteryId; |
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.14; | |
contract PurchaseAgreement { | |
uint256 public value; | |
address payable public seller; | |
address payable public buyer; | |
enum State {Created, Locked, Release, Inactive} |
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.0; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
contract MyNFT is ERC20 { | |
constructor() ERC20 ("Sandy Coins", "SAN") { | |
_mint(msg.sender, 1000 * 10 ** 18); |
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
const crypto = require("crypto"), SHA256 = message => crypto.createHash("sha256").update(message).digest("hex"); | |
class Block { | |
constructor(timestamp = "", data = []) { | |
this.timestamp = timestamp; | |
this.data = data; | |
this.hash = this.getHash(); | |
this.prevHash = ""; | |
} |
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 psycopg2 | |
import psycopg2.extras | |
hostname ='localhost' | |
database = 'demo' | |
username = 'postgres' | |
pwd = 'pwd' | |
port_id = 5432 | |
conn = None | |
cur = None |
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
const axios = require('axios'); | |
const fs = require('fs'); | |
function getGraph() { | |
} | |
const main = async () => { | |
try { |