- 博客(5)
- 收藏
- 关注
原创 ethereum event 监听 ethers.js
const { ethers } = require("ethers");const address = "0xdac17f958d2ee523a2206206994597c13d831ec7";const erc20_abi = require('./abi/erc20.json');const provider = new ethers.providers.JsonRpcProvider('https://mainnet.infura.io/');const contract = new eth
2022-04-18 17:43:10
1464
原创 枚举 json转字符串
定义时:[JsonConverter(typeof(EnumJsonConvert))]public EnumType span { get; set; } public class EnumJsonConvert<T> : JsonConverter where T : struct, IConvertible { public void EnumConverter() { if (!typeof(T).IsEnum)
2021-01-13 14:36:31
390
原创 substrate Balance, BlockNumber, AccountId 等值转换
Balance -> u64let value :Option = TryInto::::try_into(balance).ok();u64-> Balancelet balance :Option<T::Balance> = value.try_into().ok();BlockNumber -> u32let number : Option = TryInto::::try_into(block_number);u32 -> BlockNumber
2020-12-10 11:36:10
600
原创 .net Nethereum.Web3 发送带签名交易 SendRawTransaction
var web3 = new Web3("http://localhost:8545"); //转账数量 var amount = Web3.Convert.ToWei(1); Console.WriteLine($"amount: {amount}"); var callInput = (CallInput)EtherTransferTransactionInputBuilder.CreateTransactionInput(s.
2020-12-10 11:23:10
2135
原创 Remix solidity 拆分byte
把bytes 数据拆分function subbyte(bytes memory self, uint startIndex, uint len) internal pure returns (bytes memory) {require(startIndex <= self.length && self.length - startIndex >= len);uint addr = dataPtr(self);return toBytes(addr + startIn
2020-12-10 11:16:54
740
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人