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.5.12; | |
contract Destroyable{ | |
} |
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
import "./Ownable.sol"; | |
pragma solidity 0.5.12; | |
contract Destroyable is Ownable{ | |
function close() public onlyOwner { //onlyOwner is custom modifier | |
address payable ownerpayable = address(uint160(owner)); | |
selfdestruct(ownerpayable); // `owner` is the owners 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
import "./Ownable.sol"; | |
pragma solidity 0.5.12; | |
contract Destroyable is Ownable{ | |
function close() public onlyOwner { //onlyOwner is custom modifier | |
address payable ownerpayable = address(uint160(owner)); | |
selfdestruct(ownerpayable); // `owner` is the owners 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
import "./Ownable.sol"; | |
pragma solidity 0.5.12; | |
contract Destroyable is Ownable{ | |
function close() public onlyOwner { //onlyOwner is custom modifier | |
address payable ownerpayable = address(uint160(owner)); | |
selfdestruct(ownerpayable); // `owner` is the owners 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
import "./Ownable.sol"; | |
pragma solidity 0.5.12; | |
contract Destroyable is Ownable{ | |
function close() public onlyOwner { //onlyOwner is custom modifier | |
address payable ownerpayable = address(uint160(owner)); | |
selfdestruct(ownerpayable); // `owner` is the owners 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
import "./Ownable.sol"; | |
pragma solidity 0.5.12; | |
contract Destroyable is Ownable { | |
function destroy() public onlyOwner { | |
address payable receiver = msg.sender; | |
selfdestruct(receiver); | |
} | |
} |
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
#this uses the uniswap smart contract to find the exchange rate on uniswap from one token to another | |
import requests, logging, json, os, time, sys | |
from web3 import Web3 | |
tokens = json.load(open('abi/kyber_currencies.json', 'r'))["data"] | |
tokenarray = {} | |
for i in tokens: tokenarray[i["symbol"].lower()] = (Web3.toChecksumAddress(i["address"]), i["decimals"]) | |
#print(tokenarray) |
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
#this uses the uniswap smart contract to find the exchange rate on uniswap from one token to another | |
import requests, logging, json, os, time, sys | |
from web3 import Web3 | |
inputToken = sys.argv[1] | |
outputToken = sys.argv[2] | |
inputAmount = sys.argv[3] | |
tokens = json.load(open('abi/kyber_currencies.json', 'r'))["data"] |
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
#this uses the uniswap smart contract to find the exchange rate on uniswap from one token to another | |
import requests, logging, json, os, time, sys | |
from web3 import Web3 | |
inputToken = sys.argv[1] | |
outputToken = sys.argv[2] | |
inputAmount = sys.argv[3] | |
tokens = json.load(open('abi/kyber_currencies.json', 'r'))["data"] |
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
#this uses the uniswap smart contract to find the exchange rate on uniswap from one token to another | |
import requests, logging, json, os, time, sys | |
from web3 import Web3 | |
inputToken = "dai" | |
outputToken = "usdc" | |
inputAmount = 100 | |
tokens = json.load(open('abi/kyber_currencies.json', 'r'))["data"] |
OlderNewer