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
const subscribe = async () => { | |
const provider = new Web3Provider(window.ethereum); | |
const sf = new SuperfluidSdk.Framework({ ethers: provider}); | |
await sf.initialize(); | |
const user = sf.user({ | |
address: await provider.getSigner().getAddress(), | |
token: '0x6fC99F5591b51583ba15A8C2572408257A1D2797' | |
}); | |
const flow = await user.flow({ | |
recipient: '0x89Ce0f71D7387a580c6C07032f74f393a65d77F4', |
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
<html> | |
<head> | |
<script src="https://cdn.ethers.io/lib/ethers-5.2.umd.min.js"></script> | |
</head> | |
<body> | |
<h1 id="counter">0</h1> | |
<script> | |
const provider = new ethers.providers.Web3Provider(window.ethereum, "any"); | |
const signer = provider.getSigner(); | |
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.7.0 <0.9.0; | |
contract SmartBankAccount { | |
uint totalContractBalance = 0; | |
function getContractBalance() public returns(uint){ | |
return totalContractBalance; | |
} | |
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.6.0 <0.9.0; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
interface Loot { | |
function ownerOf(uint tokenId) external returns(address); |
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.6.0 <0.9.0; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
interface Loot { | |
function ownerOf(uint tokenId) external returns(address); |
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.6.0 <0.9.0; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
interface Loot { | |
function ownerOf(uint tokenId) external returns(address); |
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
const { ethers } = require("ethers"); | |
const provider = new ethers.providers.InfuraProvider( network = "ropsten" , "Paste infura project id" ) | |
provider.getBlockNumber().then(data => { | |
console.log("connected to ethereum. current block : " +data); | |
}); | |
const contractAddress = "paste address"; | |
const contractAbi = [ | |
{ | |
"inputs": [], |
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.7.0 <0.9.0; | |
contract MyErc20 { | |
string NAME = "MyErc20TokensReallyLongName"; | |
string SYMBOL = "M20"; | |
event Transfer(address indexed _from, address indexed _to, uint256 _value); | |
event Approval(address indexed _owner, address indexed _spender, uint256 _value); | |
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.7.0 <0.9.0; | |
interface cETH { | |
// define functions of COMPOUND we'll be using | |
function mint() external payable; // to deposit to compound | |
function redeem(uint redeemTokens) external returns (uint); // to withdraw from compound | |
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.7.0 <0.9.0; | |
interface cETH { | |
// define functions of COMPOUND we'll be using | |
function mint() external payable; // to deposit to compound | |
function redeem(uint redeemTokens) external returns (uint); // to withdraw from compound | |