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 createPromises(onFunctions) { | |
return onFunctions.map(onFunction => { | |
return new Promise((resolve, reject) => { | |
try { | |
onFunction(resolve) | |
} catch (e) { | |
reject(new Error(`Error in function ${onFunction.name}: ${e}`)) | |
} | |
}) | |
}) |
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
https://github.com/microsoft/TypeScript/issues/26262#issuecomment-431406596 |
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
toNonZeroInteger :: Int -> Int | |
toNonZeroInteger 0 = 1 | |
toNonZeroInteger x = if x < 0 | |
then (-x) + 1 | |
else x + 1 |
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
module Main where | |
import Prelude | |
import Effect (Effect) | |
import Effect.Console (log) | |
type Person = Age (name :: String) | |
type Age a = |
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
https://stackoverflow.com/a/63023383/3422861 | |
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}} %tab% {{.Name}}' $(docker ps -aq | |
) | sed 's#%tab%#\t#g' | sed 's#/##g' | sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n |
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
{"chain_id": 80001, "node_rpc": "https://polygon-mumbai.infura.io/v3/529aa367cbba407a98c67577f8b986a0", "Wallets": {"seller": {"address": "0xe00BCef53DD14AE43963cfdd824e78c1858Ea3a8", "private": "76d4921b8eebb1ab031a0296427262e12aef3989132e9cd77d1f4272350bb06f"}}, "erc721": {"SILVER": {"address": "0xaF27c6628135833e3bf094478829D498746A93D4", "tx": "0xf76689b73ce659068dd8f954093184c8440b6249ccee9d023547e1bcbb0a6a4e", "block_number": 25809044, "block_hash": "0xb84b2281f2af8ce1aebb51f6b57314fa085938a7d33ead6d1c8e918c2cde2f17", "name": "Silver box", "symbol": "SILVER", "total_supply": 0, "max_supply": 50000, "abi": [{"anonymous": false, "inputs": [{"indexed": true, "name": "sender", "type": "address"}, {"indexed": true, "name": "receiver", "type": "address"}, {"indexed": true, "name": "tokenId", "type": "uint256"}], "name": "Transfer", "type": "event"}, {"anonymous": false, "inputs": [{"indexed": true, "name": "owner", "type": "address"}, {"indexed": true, "name": "approved", "type": "address"}, {"indexed": true, |
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
{"chain_id": 80001, "node_rpc": "https://polygon-mumbai.infura.io/v3/529aa367cbba407a98c67577f8b986a0", "Wallets": {"exchange": {"address": "0x7A51BA6C12AF5010FE596Ad5496823C1d96E7DD9"}, "seller": {"address": "0xe00BCef53DD14AE43963cfdd824e78c1858Ea3a8"}}, "exchange_contract": {"abi": [{"inputs": [], "name": "apiVersion", "outputs": [{"name": "", "type": "string"}], "stateMutability": "pure", "type": "function"}, {"inputs": [{"name": "_contract_owner", "type": "address"}, {"name": "_platform_signing_account", "type": "address"}, {"name": "_seller_eoa", "type": "address"}], "outputs": [], "stateMutability": "nonpayable", "type": "constructor", "name": "constructor"}, {"inputs": [{"name": "_platform_signature", "type": "bytes"}, {"name": "_buyer_address", "type": "address"}, {"components": [{"name": "seller_eoa", "type": "address"}, {"name": "sale_currency", "type": "address"}, {"name": "erc721_addresses", "type": "(address,uint256,uint256)[3]"}, {"name": "collection_start_time", "type": "uint256"}, {"name": "c |
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
{"chain_id": 80001, "node_rpc": "https://polygon-mumbai.infura.io/v3/529aa367cbba407a98c67577f8b986a0", "Wallets": {"exchange": {"address": "0x94Ac3ed3b60C3262EFD35498D98b39402B317912", "private": "a9c2d97ebaee358471cc487b1d7af7ce12256789f47af3d17fc1fb598031ee4e"}, "seller": {"address": "0xe00BCef53DD14AE43963cfdd824e78c1858Ea3a8", "private": "76d4921b8eebb1ab031a0296427262e12aef3989132e9cd77d1f4272350bb06f"}, "erc20_owner": {"address": "0x7A51BA6C12AF5010FE596Ad5496823C1d96E7DD9", "private": "6ee576c44b0c9aecdcdcdbb5260fc3dde3403f67b1083253d4d902540ad32335"}}, "erc20": {"address": "0x32B00de4829aAD186e0eD0DC9c0f0c5520285A69", "tx": "0x898d7980d3104b2bd7b99815a5fd6aa86ad189e7c8f6ad6bc43e146568d734a9", "block_number": 25712224, "block_hash": "0x479b260da79ee939d52806a424e9fad589e220b264175d5c81a5b54d39854d34", "total_supply": 10000, "decimals": 18, "name": "Ampleia Coin", "symbol": "A14", "abi": [{"anonymous": false, "inputs": [{"indexed": true, "name": "sender", "type": "address"}, {"indexed": true, "name": " |
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
E brownie.exceptions.VirtualMachineError: revert: dev: invalid _signature | |
E Trace step 619, program counter 4422: | |
E File "contracts/exchange_presale.vy", line 204, in exchange_presale.checkSellerSignature: | |
E v: uint256 = convert(slice(_signature, 64, 1), uint256) | |
E assert ecrecover(digest, v, r, s) == _sellers_signing_account # dev: invalid _signature | |
E return digest | |
tests/test_exchange_presale.py:309: VirtualMachineError |
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
def sign_seller_signature(): | |
def sign_seller_signature( | |
contract, | |
sellers_signing_account: Account, # NOTE: Must be a eth_key account, not Brownie | |
seller_address, | |
seller_erc20_address, | |
seller_info, | |
): | |
name = "Ampleia" | |
version = contract.apiVersion() |
NewerOlder