Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (16 sloc) 544 Bytes
using System.Numerics;
using Nethereum.Hex.HexConvertors.Extensions;
using Nethereum.RLP;
namespace Nethereum.Util
{
public static class ContractUtils
{
public static string CalculateContractAddress(string address, BigInteger nonce)
{
var sha3 = new Sha3Keccack();
return
sha3.CalculateHash(RLP.RLP.EncodeList(RLP.RLP.EncodeElement(address.HexToByteArray()),
RLP.RLP.EncodeElement(nonce.ToBytesForRLPEncoding()))).ToHex().Substring(24);
}
}
}
You can’t perform that action at this time.