diff --git a/config/src/main/java/tech/pegasys/pantheon/config/GenesisAllocation.java b/config/src/main/java/tech/pegasys/pantheon/config/GenesisAllocation.java index e4372857a3..f748e1fccb 100644 --- a/config/src/main/java/tech/pegasys/pantheon/config/GenesisAllocation.java +++ b/config/src/main/java/tech/pegasys/pantheon/config/GenesisAllocation.java @@ -37,6 +37,10 @@ public String getCode() { return data.getString("code"); } + public String getVersion() { + return data.getString("version"); + } + public Map getStorage() { return data.getJsonObject("storage", new JsonObject()).getMap(); } diff --git a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/chain/GenesisState.java b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/chain/GenesisState.java index 866bdbb9a5..1a7fa2a58d 100644 --- a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/chain/GenesisState.java +++ b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/chain/GenesisState.java @@ -14,6 +14,7 @@ import tech.pegasys.pantheon.config.GenesisAllocation; import tech.pegasys.pantheon.config.GenesisConfigFile; +import tech.pegasys.pantheon.ethereum.core.Account; import tech.pegasys.pantheon.ethereum.core.Address; import tech.pegasys.pantheon.ethereum.core.Block; import tech.pegasys.pantheon.ethereum.core.BlockBody; @@ -111,6 +112,7 @@ private static void writeAccountsTo( final MutableAccount account = updater.getOrCreate(genesisAccount.address); account.setBalance(genesisAccount.balance); account.setCode(genesisAccount.code); + account.setVersion(genesisAccount.version); genesisAccount.storage.forEach(account::setStorageValue); }); updater.commit(); @@ -216,25 +218,29 @@ private static final class GenesisAccount { final Address address; final Wei balance; - final BytesValue code; final Map storage; + final BytesValue code; + final int version; - public static GenesisAccount fromAllocation(final GenesisAllocation allocation) { + static GenesisAccount fromAllocation(final GenesisAllocation allocation) { return new GenesisAccount( allocation.getAddress(), allocation.getBalance(), + allocation.getStorage(), allocation.getCode(), - allocation.getStorage()); + allocation.getVersion()); } private GenesisAccount( final String hexAddress, final String balance, + final Map storage, final String hexCode, - final Map storage) { + final String version) { this.address = withNiceErrorMessage("address", hexAddress, Address::fromHexString); this.balance = withNiceErrorMessage("balance", balance, this::parseBalance); this.code = hexCode != null ? BytesValue.fromHexString(hexCode) : null; + this.version = version != null ? Integer.decode(version) : Account.DEFAULT_VERSION; this.storage = parseStorage(storage); } @@ -265,8 +271,9 @@ public String toString() { return MoreObjects.toStringHelper(this) .add("address", address) .add("balance", balance) - .add("code", code) .add("storage", storage) + .add("code", code) + .add("version", version) .toString(); } } diff --git a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/core/AbstractWorldUpdater.java b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/core/AbstractWorldUpdater.java index 183c85e72b..71405cfa4f 100644 --- a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/core/AbstractWorldUpdater.java +++ b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/core/AbstractWorldUpdater.java @@ -163,6 +163,7 @@ public static class UpdateTrackingAccount implements MutableA private long nonce; private Wei balance; + private int version; @Nullable private BytesValue updatedCode; // Null if the underlying code has not been updated. @Nullable private Hash updatedCodeHash; @@ -179,6 +180,7 @@ public static class UpdateTrackingAccount implements MutableA this.nonce = 0; this.balance = Wei.ZERO; + this.version = Account.DEFAULT_VERSION; this.updatedCode = BytesValue.EMPTY; this.updatedStorage = new TreeMap<>(); @@ -192,6 +194,7 @@ public static class UpdateTrackingAccount implements MutableA this.nonce = account.getNonce(); this.balance = account.getBalance(); + this.version = account.getVersion(); this.updatedStorage = new TreeMap<>(); } @@ -283,6 +286,16 @@ public void setCode(final BytesValue code) { this.updatedCode = code; } + @Override + public void setVersion(final int version) { + this.version = version; + } + + @Override + public int getVersion() { + return version; + } + @Override public UInt256 getStorageValue(final UInt256 key) { final UInt256 value = updatedStorage.get(key); @@ -358,7 +371,7 @@ public String toString() { static class StackedUpdater extends AbstractWorldUpdater, UpdateTrackingAccount> { - protected StackedUpdater(final AbstractWorldUpdater world) { + StackedUpdater(final AbstractWorldUpdater world) { super(world); } @@ -419,6 +432,7 @@ public void commit() { existing.setBalance(update.getBalance()); if (update.codeWasUpdated()) { existing.setCode(update.getCode()); + existing.setVersion(update.getVersion()); } if (update.getStorageWasCleared()) { existing.clearStorage(); diff --git a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/core/Account.java b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/core/Account.java index 6a9afb8e75..c52012ad1a 100644 --- a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/core/Account.java +++ b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/core/Account.java @@ -31,12 +31,14 @@ * practice, only non-zero mappings are stored and setting a key to the value 0 is akin to * "removing" that key). *
  • Code: arbitrary-length sequence of bytes that corresponds to EVM bytecode. + *
  • Version: the version of the EVM bytecode. * */ public interface Account { long DEFAULT_NONCE = 0L; Wei DEFAULT_BALANCE = Wei.ZERO; + int DEFAULT_VERSION = 0; /** * The Keccak-256 hash of the account address. @@ -83,7 +85,7 @@ default Hash getAddressHash() { /** * The hash of the EVM bytecode associated with this account. * - * @return the hash of the account code (which may be {@link Hash#EMPTY}. + * @return the hash of the account code (which may be {@link Hash#EMPTY}). */ Hash getCodeHash(); @@ -99,6 +101,13 @@ default boolean hasCode() { return !getCode().isEmpty(); } + /** + * The version of the EVM bytecode associated with this account. + * + * @return the version of the account code. Default is zero. + */ + int getVersion(); + /** * Retrieves a value in the account storage given its key. * diff --git a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/core/MutableAccount.java b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/core/MutableAccount.java index c0010e2aaa..a4d98ab273 100644 --- a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/core/MutableAccount.java +++ b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/core/MutableAccount.java @@ -82,6 +82,13 @@ default Wei decrementBalance(final Wei value) { */ void setCode(BytesValue code); + /** + * Sets the version for the account. + * + * @param version the version of the code being set + */ + void setVersion(int version); + /** * Sets a particular key-value pair in the account storage. * diff --git a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/MainnetContractCreationProcessor.java b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/MainnetContractCreationProcessor.java index 12987dadd8..cfb2072f48 100644 --- a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/MainnetContractCreationProcessor.java +++ b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/MainnetContractCreationProcessor.java @@ -40,18 +40,39 @@ public class MainnetContractCreationProcessor extends AbstractMessageProcessor { private final int codeSizeLimit; + private final int accountVersion; + public MainnetContractCreationProcessor( final GasCalculator gasCalculator, final EVM evm, final boolean requireCodeDepositToSucceed, final int codeSizeLimit, final long initialContractNonce, - final Collection
    forceCommitAddresses) { + final Collection
    forceCommitAddresses, + final int accountVersion) { super(evm, forceCommitAddresses); this.gasCalculator = gasCalculator; this.requireCodeDepositToSucceed = requireCodeDepositToSucceed; this.codeSizeLimit = codeSizeLimit; this.initialContractNonce = initialContractNonce; + this.accountVersion = accountVersion; + } + + public MainnetContractCreationProcessor( + final GasCalculator gasCalculator, + final EVM evm, + final boolean requireCodeDepositToSucceed, + final int codeSizeLimit, + final long initialContractNonce, + final Collection
    forceCommitAddresses) { + this( + gasCalculator, + evm, + requireCodeDepositToSucceed, + codeSizeLimit, + initialContractNonce, + forceCommitAddresses, + Account.DEFAULT_VERSION); } public MainnetContractCreationProcessor( @@ -66,7 +87,8 @@ public MainnetContractCreationProcessor( requireCodeDepositToSucceed, codeSizeLimit, initialContractNonce, - ImmutableSet.of()); + ImmutableSet.of(), + Account.DEFAULT_VERSION); } private static boolean accountExists(final Account account) { @@ -131,6 +153,7 @@ protected void codeSuccess(final MessageFrame frame) { final MutableAccount contract = frame.getWorldState().getOrCreate(frame.getContractAddress()); contract.setCode(contractCode); + contract.setVersion(accountVersion); LOG.trace( "Successful creation of contract {} with code of size {} (Gas remaining: {})", frame.getContractAddress(), diff --git a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/MainnetProtocolSpecs.java b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/MainnetProtocolSpecs.java index ac7f43c6b0..3581dad4bc 100644 --- a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/MainnetProtocolSpecs.java +++ b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/MainnetProtocolSpecs.java @@ -265,11 +265,23 @@ public static ProtocolSpecBuilder constantinopleFixDefinition( public static ProtocolSpecBuilder istanbulDefinition( final Optional chainId, - final OptionalInt contractSizeLimit, + final OptionalInt configContractSizeLimit, final OptionalInt configStackSizeLimit, final boolean enableRevertReason) { + final int contractSizeLimit = + configContractSizeLimit.orElse(SPURIOUS_DRAGON_CONTRACT_SIZE_LIMIT); return constantinopleFixDefinition( - chainId, contractSizeLimit, configStackSizeLimit, enableRevertReason) + chainId, configContractSizeLimit, configStackSizeLimit, enableRevertReason) + .contractCreationProcessorBuilder( + (gasCalculator, evm) -> + new MainnetContractCreationProcessor( + gasCalculator, + evm, + true, + contractSizeLimit, + 1, + SPURIOUS_DRAGON_FORCE_DELETE_WHEN_EMPTY_ADDRESSES, + 1)) .name("Istanbul"); } diff --git a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/worldstate/DefaultMutableWorldState.java b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/worldstate/DefaultMutableWorldState.java index cde611886e..df77dfb3e4 100644 --- a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/worldstate/DefaultMutableWorldState.java +++ b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/worldstate/DefaultMutableWorldState.java @@ -108,9 +108,13 @@ private AccountState deserializeAccount( } private static BytesValue serializeAccount( - final long nonce, final Wei balance, final Hash storageRoot, final Hash codeHash) { + final long nonce, + final Wei balance, + final Hash storageRoot, + final Hash codeHash, + final int version) { final StateTrieAccountValue accountValue = - new StateTrieAccountValue(nonce, balance, storageRoot, codeHash); + new StateTrieAccountValue(nonce, balance, storageRoot, codeHash, version); return RLP.encode(accountValue::writeTo); } @@ -243,6 +247,11 @@ public Hash getCodeHash() { return accountValue.getCodeHash(); } + @Override + public int getVersion() { + return accountValue.getVersion(); + } + @Override public UInt256 getStorageValue(final UInt256 key) { final Optional val = storageTrie().get(Hash.hash(key.getBytes())); @@ -283,6 +292,7 @@ public String toString() { builder.append("balance=").append(getBalance()).append(", "); builder.append("storageRoot=").append(getStorageRoot()).append(", "); builder.append("codeHash=").append(getCodeHash()); + builder.append("version=").append(getVersion()); return builder.append("}").toString(); } } @@ -364,7 +374,12 @@ public void commit() { // Lastly, save the new account. final BytesValue account = - serializeAccount(updated.getNonce(), updated.getBalance(), storageRoot, codeHash); + serializeAccount( + updated.getNonce(), + updated.getBalance(), + storageRoot, + codeHash, + updated.getVersion()); wrapped.accountStateTrie.put(updated.getAddressHash(), account); } diff --git a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/worldstate/StateTrieAccountValue.java b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/worldstate/StateTrieAccountValue.java index 57e5c11c4b..e55d11e2d5 100644 --- a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/worldstate/StateTrieAccountValue.java +++ b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/worldstate/StateTrieAccountValue.java @@ -12,6 +12,7 @@ */ package tech.pegasys.pantheon.ethereum.worldstate; +import tech.pegasys.pantheon.ethereum.core.Account; import tech.pegasys.pantheon.ethereum.core.Hash; import tech.pegasys.pantheon.ethereum.core.Wei; import tech.pegasys.pantheon.ethereum.rlp.RLPInput; @@ -24,13 +25,24 @@ public class StateTrieAccountValue { private final Wei balance; private final Hash storageRoot; private final Hash codeHash; + private final int version; - public StateTrieAccountValue( + private StateTrieAccountValue( final long nonce, final Wei balance, final Hash storageRoot, final Hash codeHash) { + this(nonce, balance, storageRoot, codeHash, Account.DEFAULT_VERSION); + } + + public StateTrieAccountValue( + final long nonce, + final Wei balance, + final Hash storageRoot, + final Hash codeHash, + final int version) { this.nonce = nonce; this.balance = balance; this.storageRoot = storageRoot; this.codeHash = codeHash; + this.version = version; } /** @@ -63,12 +75,21 @@ public Hash getStorageRoot() { /** * The hash of the EVM bytecode associated with this account. * - * @return the hash of the account code (which may be {@link Hash#EMPTY}. + * @return the hash of the account code (which may be {@link Hash#EMPTY}). */ public Hash getCodeHash() { return codeHash; } + /** + * The version of the EVM bytecode associated with this account. + * + * @return the version of the account code. + */ + public int getVersion() { + return version; + } + public void writeTo(final RLPOutput out) { out.startList(); @@ -77,6 +98,11 @@ public void writeTo(final RLPOutput out) { out.writeBytesValue(storageRoot); out.writeBytesValue(codeHash); + if (version != Account.DEFAULT_VERSION) { + // version of zero is never written out. + out.writeLongScalar(version); + } + out.endList(); } @@ -87,9 +113,15 @@ public static StateTrieAccountValue readFrom(final RLPInput in) { final Wei balance = in.readUInt256Scalar(Wei::wrap); final Hash storageRoot = Hash.wrap(in.readBytes32()); final Hash codeHash = Hash.wrap(in.readBytes32()); + final int version; + if (!in.isEndOfCurrentList()) { + version = in.readIntScalar(); + } else { + version = Account.DEFAULT_VERSION; + } in.leaveList(); - return new StateTrieAccountValue(nonce, balance, storageRoot, codeHash); + return new StateTrieAccountValue(nonce, balance, storageRoot, codeHash, version); } } diff --git a/ethereum/core/src/test-support/java/tech/pegasys/pantheon/ethereum/core/BlockDataGenerator.java b/ethereum/core/src/test-support/java/tech/pegasys/pantheon/ethereum/core/BlockDataGenerator.java index 8685309194..903a294771 100644 --- a/ethereum/core/src/test-support/java/tech/pegasys/pantheon/ethereum/core/BlockDataGenerator.java +++ b/ethereum/core/src/test-support/java/tech/pegasys/pantheon/ethereum/core/BlockDataGenerator.java @@ -153,6 +153,7 @@ private List createRandomAccounts( if (random.nextFloat() < percentContractAccounts) { // Some percentage of accounts are contract accounts account.setCode(bytesValue(5, 50)); + account.setVersion(Account.DEFAULT_VERSION); if (random.nextFloat() < percentContractAccountsWithNonEmptyStorage) { // Add some storage for contract accounts int storageValues = random.nextInt(20) + 10; diff --git a/ethereum/core/src/test-support/java/tech/pegasys/pantheon/ethereum/core/MessageFrameTestFixture.java b/ethereum/core/src/test-support/java/tech/pegasys/pantheon/ethereum/core/MessageFrameTestFixture.java index 3551d09a34..4fa58dc7dd 100644 --- a/ethereum/core/src/test-support/java/tech/pegasys/pantheon/ethereum/core/MessageFrameTestFixture.java +++ b/ethereum/core/src/test-support/java/tech/pegasys/pantheon/ethereum/core/MessageFrameTestFixture.java @@ -30,7 +30,7 @@ public class MessageFrameTestFixture { - private static final Address DEFAUT_ADDRESS = AddressHelpers.ofValue(244259721); + public static final Address DEFAUT_ADDRESS = AddressHelpers.ofValue(244259721); private final int maxStackSize = DEFAULT_MAX_STACK_SIZE; private Type type = Type.MESSAGE_CALL; diff --git a/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/chain/GenesisStateTest.java b/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/chain/GenesisStateTest.java index d340cf8446..10c59deba2 100644 --- a/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/chain/GenesisStateTest.java +++ b/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/chain/GenesisStateTest.java @@ -88,17 +88,14 @@ public void createFromJsonNoAllocs() throws Exception { assertThat(header.getParentHash()).isEqualTo(Hash.ZERO); } - @Test - public void createFromJsonWithContract() throws Exception { + private void assertContractInvariants( + final String sourceFile, final String blockHash, final int version) throws Exception { final GenesisState genesisState = GenesisState.fromJson( - Resources.toString(GenesisStateTest.class.getResource("genesis3.json"), Charsets.UTF_8), + Resources.toString(GenesisStateTest.class.getResource(sourceFile), Charsets.UTF_8), MainnetProtocolSchedule.create()); final BlockHeader header = genesisState.getBlock().getHeader(); - assertThat(header.getHash()) - .isEqualTo( - Hash.fromHexString( - "0xe7fd8db206dcaf066b7c97b8a42a0abc18653613560748557ab44868652a78b6")); + assertThat(header.getHash()).isEqualTo(Hash.fromHexString(blockHash)); final DefaultMutableWorldState worldState = new DefaultMutableWorldState(new WorldStateKeyValueStorage(new InMemoryKeyValueStorage())); @@ -106,6 +103,7 @@ public void createFromJsonWithContract() throws Exception { final Account contract = worldState.get(Address.fromHexString("0x3850000000000000000000000000000000000000")); assertThat(contract.getCode()).isEqualTo(BytesValue.fromHexString(EXPECTED_CODE)); + assertThat(contract.getVersion()).isEqualTo(version); assertStorageValue( contract, "c2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d", @@ -116,6 +114,18 @@ public void createFromJsonWithContract() throws Exception { "000000000000000000000000385ef55e292fa39cf5ffbad99f534294565519ba"); } + @Test + public void createFromJsonWithContract() throws Exception { + assertContractInvariants( + "genesis3.json", "0xe7fd8db206dcaf066b7c97b8a42a0abc18653613560748557ab44868652a78b6", 0); + } + + @Test + public void createFromJsonWithVersion() throws Exception { + assertContractInvariants( + "genesis4.json", "0x3224ddae856381f5fb67492b4561ecbc0cb1e9e50e6cf3238f6e049fe95a8604", 1); + } + @Test public void encodeOlympicBlock() throws Exception { final GenesisState genesisState = diff --git a/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/vm/WorldStateMock.java b/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/vm/WorldStateMock.java index 5c58f13c74..0ecbcc2299 100644 --- a/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/vm/WorldStateMock.java +++ b/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/vm/WorldStateMock.java @@ -33,6 +33,7 @@ public static class AccountMock { private final long nonce; private final Wei balance; private final BytesValue code; + private final int version; private final Map storage; private static final Map parseStorage(final Map values) { @@ -47,26 +48,36 @@ public AccountMock( @JsonProperty("nonce") final String nonce, @JsonProperty("balance") final String balance, @JsonProperty("storage") final Map storage, - @JsonProperty("code") final String code) { + @JsonProperty("code") final String code, + @JsonProperty("version") final String version) { this.nonce = Long.decode(nonce); this.balance = Wei.fromHexString(balance); this.code = BytesValue.fromHexString(code); this.storage = parseStorage(storage); + if (version != null) { + this.version = Integer.decode(version); + } else { + this.version = 0; + } } - public long nonce() { + public long getNonce() { return nonce; } - public Wei balance() { + public Wei getBalance() { return balance; } - public BytesValue code() { + public BytesValue getCode() { return code; } - public Map storage() { + public int getVersion() { + return version; + } + + public Map getStorage() { return storage; } } @@ -74,10 +85,11 @@ public Map storage() { public static void insertAccount( final WorldUpdater updater, final Address address, final AccountMock toCopy) { final MutableAccount account = updater.getOrCreate(address); - account.setNonce(toCopy.nonce()); - account.setBalance(toCopy.balance()); - account.setCode(toCopy.code()); - for (final Map.Entry entry : toCopy.storage().entrySet()) { + account.setNonce(toCopy.getNonce()); + account.setBalance(toCopy.getBalance()); + account.setCode(toCopy.getCode()); + account.setVersion(toCopy.getVersion()); + for (final Map.Entry entry : toCopy.getStorage().entrySet()) { account.setStorageValue(entry.getKey(), entry.getValue()); } } diff --git a/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/vm/operations/ExtCodeHashOperationTest.java b/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/vm/operations/ExtCodeHashOperationTest.java index 4cb2eb8e89..45275e83cc 100644 --- a/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/vm/operations/ExtCodeHashOperationTest.java +++ b/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/vm/operations/ExtCodeHashOperationTest.java @@ -16,6 +16,7 @@ import static org.mockito.Mockito.mock; import tech.pegasys.pantheon.ethereum.chain.Blockchain; +import tech.pegasys.pantheon.ethereum.core.Account; import tech.pegasys.pantheon.ethereum.core.Address; import tech.pegasys.pantheon.ethereum.core.AddressHelpers; import tech.pegasys.pantheon.ethereum.core.BlockHeader; @@ -23,6 +24,7 @@ import tech.pegasys.pantheon.ethereum.core.Gas; import tech.pegasys.pantheon.ethereum.core.Hash; import tech.pegasys.pantheon.ethereum.core.MessageFrameTestFixture; +import tech.pegasys.pantheon.ethereum.core.MutableAccount; import tech.pegasys.pantheon.ethereum.core.Wei; import tech.pegasys.pantheon.ethereum.core.WorldUpdater; import tech.pegasys.pantheon.ethereum.mainnet.ConstantinopleGasCalculator; @@ -88,7 +90,9 @@ public void shouldReturnEmptyCodeHashWhenPrecompileHasBalance() { @Test public void shouldGetHashOfAccountCodeWhenCodeIsPresent() { final BytesValue code = BytesValue.fromHexString("0xabcdef"); - worldStateUpdater.getOrCreate(REQUESTED_ADDRESS).setCode(code); + final MutableAccount account = worldStateUpdater.getOrCreate(REQUESTED_ADDRESS); + account.setCode(code); + account.setVersion(Account.DEFAULT_VERSION); assertThat(executeOperation(REQUESTED_ADDRESS)).isEqualTo(Hash.hash(code)); } @@ -96,7 +100,9 @@ public void shouldGetHashOfAccountCodeWhenCodeIsPresent() { public void shouldZeroOutLeftMostBitsToGetAddress() { // If EXTCODEHASH of A is X, then EXTCODEHASH of A + 2**160 is X. final BytesValue code = BytesValue.fromHexString("0xabcdef"); - worldStateUpdater.getOrCreate(REQUESTED_ADDRESS).setCode(code); + final MutableAccount account = worldStateUpdater.getOrCreate(REQUESTED_ADDRESS); + account.setCode(code); + account.setVersion(Account.DEFAULT_VERSION); final Bytes32 value = Words.fromAddress(REQUESTED_ADDRESS) .asUInt256() diff --git a/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/worldstate/DefaultMutableWorldStateTest.java b/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/worldstate/DefaultMutableWorldStateTest.java index 620d5acff6..102766f972 100644 --- a/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/worldstate/DefaultMutableWorldStateTest.java +++ b/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/worldstate/DefaultMutableWorldStateTest.java @@ -18,6 +18,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; +import tech.pegasys.pantheon.ethereum.core.Account; import tech.pegasys.pantheon.ethereum.core.Address; import tech.pegasys.pantheon.ethereum.core.Hash; import tech.pegasys.pantheon.ethereum.core.MutableAccount; @@ -482,9 +483,11 @@ public void replaceAccountCode() { final MutableAccount account = updater.createAccount(ADDRESS); account.setBalance(Wei.of(100000)); account.setCode(BytesValue.of(1, 2, 3)); + account.setVersion(Account.DEFAULT_VERSION); account.setCode(BytesValue.of(3, 2, 1)); updater.commit(); assertEquals(BytesValue.of(3, 2, 1), worldState.get(ADDRESS).getCode()); + assertEquals(Account.DEFAULT_VERSION, worldState.get(ADDRESS).getVersion()); assertEquals( Hash.fromHexString("0xc14f5e30581de9155ea092affa665fad83bcd9f98e45c4a42885b9b36d939702"), worldState.rootHash()); diff --git a/ethereum/core/src/test/resources/tech/pegasys/pantheon/ethereum/chain/genesis4.json b/ethereum/core/src/test/resources/tech/pegasys/pantheon/ethereum/chain/genesis4.json new file mode 100644 index 0000000000..084b95d169 --- /dev/null +++ b/ethereum/core/src/test/resources/tech/pegasys/pantheon/ethereum/chain/genesis4.json @@ -0,0 +1,834 @@ +{ + "config": { + "chainId": 385, + "homesteadBlock": 1, + "eip150Block": 2, + "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "eip155Block": 3, + "eip158Block": 3, + "byzantiumBlock": 4, + "clique": { + "period": 15, + "epoch": 30000 + } + }, + "coinbase": "0x0000000000000000000000000000000000000000", + "difficulty": "0x1", + "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000385A157F6CC00D980420E50CB2083054CEA32E90385BED87AA69123A53212D67C1119FE32E1619AB38500F1002084341BF47EE913C4DC2CD92EDE0EA38505E728533BF27620601F396231EDB2D7C3088385FD8E4EB6F360A1A76BF27BFC03F0FBFBD6CEB385EF55E292FA39CF5FFBAD99F534294565519BA0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "gasLimit": "0xa00000", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0", + "timestamp": "0x5c125b0e", + "alloc": { + "0000000000000000000000000000000000000000": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000001": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000002": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000003": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000004": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000005": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000006": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000007": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000008": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000009": { + "balance": "0x1" + }, + "000000000000000000000000000000000000000a": { + "balance": "0x1" + }, + "000000000000000000000000000000000000000b": { + "balance": "0x1" + }, + "000000000000000000000000000000000000000c": { + "balance": "0x1" + }, + "000000000000000000000000000000000000000d": { + "balance": "0x1" + }, + "000000000000000000000000000000000000000e": { + "balance": "0x1" + }, + "000000000000000000000000000000000000000f": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000010": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000011": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000012": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000013": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000014": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000015": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000016": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000017": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000018": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000019": { + "balance": "0x1" + }, + "000000000000000000000000000000000000001a": { + "balance": "0x1" + }, + "000000000000000000000000000000000000001b": { + "balance": "0x1" + }, + "000000000000000000000000000000000000001c": { + "balance": "0x1" + }, + "000000000000000000000000000000000000001d": { + "balance": "0x1" + }, + "000000000000000000000000000000000000001e": { + "balance": "0x1" + }, + "000000000000000000000000000000000000001f": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000020": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000021": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000022": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000023": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000024": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000025": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000026": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000027": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000028": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000029": { + "balance": "0x1" + }, + "000000000000000000000000000000000000002a": { + "balance": "0x1" + }, + "000000000000000000000000000000000000002b": { + "balance": "0x1" + }, + "000000000000000000000000000000000000002c": { + "balance": "0x1" + }, + "000000000000000000000000000000000000002d": { + "balance": "0x1" + }, + "000000000000000000000000000000000000002e": { + "balance": "0x1" + }, + "000000000000000000000000000000000000002f": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000030": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000031": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000032": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000033": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000034": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000035": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000036": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000037": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000038": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000039": { + "balance": "0x1" + }, + "000000000000000000000000000000000000003a": { + "balance": "0x1" + }, + "000000000000000000000000000000000000003b": { + "balance": "0x1" + }, + "000000000000000000000000000000000000003c": { + "balance": "0x1" + }, + "000000000000000000000000000000000000003d": { + "balance": "0x1" + }, + "000000000000000000000000000000000000003e": { + "balance": "0x1" + }, + "000000000000000000000000000000000000003f": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000040": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000041": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000042": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000043": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000044": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000045": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000046": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000047": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000048": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000049": { + "balance": "0x1" + }, + "000000000000000000000000000000000000004a": { + "balance": "0x1" + }, + "000000000000000000000000000000000000004b": { + "balance": "0x1" + }, + "000000000000000000000000000000000000004c": { + "balance": "0x1" + }, + "000000000000000000000000000000000000004d": { + "balance": "0x1" + }, + "000000000000000000000000000000000000004e": { + "balance": "0x1" + }, + "000000000000000000000000000000000000004f": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000050": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000051": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000052": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000053": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000054": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000055": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000056": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000057": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000058": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000059": { + "balance": "0x1" + }, + "000000000000000000000000000000000000005a": { + "balance": "0x1" + }, + "000000000000000000000000000000000000005b": { + "balance": "0x1" + }, + "000000000000000000000000000000000000005c": { + "balance": "0x1" + }, + "000000000000000000000000000000000000005d": { + "balance": "0x1" + }, + "000000000000000000000000000000000000005e": { + "balance": "0x1" + }, + "000000000000000000000000000000000000005f": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000060": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000061": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000062": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000063": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000064": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000065": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000066": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000067": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000068": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000069": { + "balance": "0x1" + }, + "000000000000000000000000000000000000006a": { + "balance": "0x1" + }, + "000000000000000000000000000000000000006b": { + "balance": "0x1" + }, + "000000000000000000000000000000000000006c": { + "balance": "0x1" + }, + "000000000000000000000000000000000000006d": { + "balance": "0x1" + }, + "000000000000000000000000000000000000006e": { + "balance": "0x1" + }, + "000000000000000000000000000000000000006f": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000070": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000071": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000072": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000073": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000074": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000075": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000076": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000077": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000078": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000079": { + "balance": "0x1" + }, + "000000000000000000000000000000000000007a": { + "balance": "0x1" + }, + "000000000000000000000000000000000000007b": { + "balance": "0x1" + }, + "000000000000000000000000000000000000007c": { + "balance": "0x1" + }, + "000000000000000000000000000000000000007d": { + "balance": "0x1" + }, + "000000000000000000000000000000000000007e": { + "balance": "0x1" + }, + "000000000000000000000000000000000000007f": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000080": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000081": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000082": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000083": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000084": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000085": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000086": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000087": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000088": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000089": { + "balance": "0x1" + }, + "000000000000000000000000000000000000008a": { + "balance": "0x1" + }, + "000000000000000000000000000000000000008b": { + "balance": "0x1" + }, + "000000000000000000000000000000000000008c": { + "balance": "0x1" + }, + "000000000000000000000000000000000000008d": { + "balance": "0x1" + }, + "000000000000000000000000000000000000008e": { + "balance": "0x1" + }, + "000000000000000000000000000000000000008f": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000090": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000091": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000092": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000093": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000094": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000095": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000096": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000097": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000098": { + "balance": "0x1" + }, + "0000000000000000000000000000000000000099": { + "balance": "0x1" + }, + "000000000000000000000000000000000000009a": { + "balance": "0x1" + }, + "000000000000000000000000000000000000009b": { + "balance": "0x1" + }, + "000000000000000000000000000000000000009c": { + "balance": "0x1" + }, + "000000000000000000000000000000000000009d": { + "balance": "0x1" + }, + "000000000000000000000000000000000000009e": { + "balance": "0x1" + }, + "000000000000000000000000000000000000009f": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000a0": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000a1": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000a2": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000a3": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000a4": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000a5": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000a6": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000a7": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000a8": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000a9": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000aa": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000ab": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000ac": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000ad": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000ae": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000af": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000b0": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000b1": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000b2": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000b3": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000b4": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000b5": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000b6": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000b7": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000b8": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000b9": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000ba": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000bb": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000bc": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000bd": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000be": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000bf": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000c0": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000c1": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000c2": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000c3": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000c4": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000c5": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000c6": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000c7": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000c8": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000c9": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000ca": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000cb": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000cc": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000cd": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000ce": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000cf": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000d0": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000d1": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000d2": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000d3": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000d4": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000d5": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000d6": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000d7": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000d8": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000d9": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000da": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000db": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000dc": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000dd": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000de": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000df": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000e0": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000e1": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000e2": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000e3": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000e4": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000e5": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000e6": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000e7": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000e8": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000e9": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000ea": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000eb": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000ec": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000ed": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000ee": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000ef": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000f0": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000f1": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000f2": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000f3": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000f4": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000f5": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000f6": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000f7": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000f8": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000f9": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000fa": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000fb": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000fc": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000fd": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000fe": { + "balance": "0x1" + }, + "00000000000000000000000000000000000000ff": { + "balance": "0x1" + }, + "0x385a157f6cc00d980420e50cb2083054cea32e90": { + "balance": "0x033b2e3c9fd0803ce8000000" + }, + "0x385bed87aa69123a53212d67c1119fe32e1619ab": { + "balance": "0x033b2e3c9fd0803ce8000000" + }, + "0x38500f1002084341bf47ee913c4dc2cd92ede0ea": { + "balance": "0x033b2e3c9fd0803ce8000000" + }, + "0x38505e728533bf27620601f396231edb2d7c3088": { + "balance": "0x033b2e3c9fd0803ce8000000" + }, + "0x385fd8e4eb6f360a1a76bf27bfc03f0fbfbd6ceb": { + "balance": "0x033b2e3c9fd0803ce8000000" + }, + "0x385ef55e292fa39cf5ffbad99f534294565519ba": { + "balance": "0x033b2e3c9fd0803ce8000000" + }, + "0x3850000000000000000000000000000000000000": { + "balance": "0x100000000000000000000000000000000000000000000000000", + "code": "0x608060405260043610610116577c01000000000000000000000000000000000000000000000000000000006000350463025e7c278114610158578063173825d91461019e57806320ea8d86146101d15780632f54bf6e146101fb5780633411c81c14610242578063547415251461027b5780637065cb48146102c1578063784547a7146102f45780638b51d13f1461031e5780639ace38c214610348578063a0e67e2b14610415578063a8abe69a1461047a578063b5dc40c3146104ba578063b77bf600146104e4578063ba51a6df146104f9578063c01a8c8414610523578063c64274741461054d578063d74f8edd14610615578063dc8452cd1461062a578063e20056e61461063f578063ee22610b1461067a575b60003411156101565760408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b34801561016457600080fd5b506101826004803603602081101561017b57600080fd5b50356106a4565b60408051600160a060020a039092168252519081900360200190f35b3480156101aa57600080fd5b50610156600480360360208110156101c157600080fd5b5035600160a060020a03166106cc565b3480156101dd57600080fd5b50610156600480360360208110156101f457600080fd5b503561083c565b34801561020757600080fd5b5061022e6004803603602081101561021e57600080fd5b5035600160a060020a03166108f6565b604080519115158252519081900360200190f35b34801561024e57600080fd5b5061022e6004803603604081101561026557600080fd5b5080359060200135600160a060020a031661090b565b34801561028757600080fd5b506102af6004803603604081101561029e57600080fd5b50803515159060200135151561092b565b60408051918252519081900360200190f35b3480156102cd57600080fd5b50610156600480360360208110156102e457600080fd5b5035600160a060020a0316610997565b34801561030057600080fd5b5061022e6004803603602081101561031757600080fd5b5035610abc565b34801561032a57600080fd5b506102af6004803603602081101561034157600080fd5b5035610b43565b34801561035457600080fd5b506103726004803603602081101561036b57600080fd5b5035610bb2565b6040518085600160a060020a0316600160a060020a031681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b838110156103d75781810151838201526020016103bf565b50505050905090810190601f1680156104045780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561042157600080fd5b5061042a610c70565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561046657818101518382015260200161044e565b505050509050019250505060405180910390f35b34801561048657600080fd5b5061042a6004803603608081101561049d57600080fd5b508035906020810135906040810135151590606001351515610cd3565b3480156104c657600080fd5b5061042a600480360360208110156104dd57600080fd5b5035610e04565b3480156104f057600080fd5b506102af610f75565b34801561050557600080fd5b506101566004803603602081101561051c57600080fd5b5035610f7b565b34801561052f57600080fd5b506101566004803603602081101561054657600080fd5b5035610ffa565b34801561055957600080fd5b506102af6004803603606081101561057057600080fd5b600160a060020a03823516916020810135918101906060810160408201356401000000008111156105a057600080fd5b8201836020820111156105b257600080fd5b803590602001918460018302840111640100000000831117156105d457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506110c5945050505050565b34801561062157600080fd5b506102af6110e4565b34801561063657600080fd5b506102af6110e9565b34801561064b57600080fd5b506101566004803603604081101561066257600080fd5b50600160a060020a03813581169160200135166110ef565b34801561068657600080fd5b506101566004803603602081101561069d57600080fd5b5035611289565b60038054829081106106b257fe5b600091825260209091200154600160a060020a0316905081565b3330146106d857600080fd5b600160a060020a038116600090815260026020526040902054819060ff16151561070157600080fd5b600160a060020a0382166000908152600260205260408120805460ff191690555b600354600019018110156107d75782600160a060020a031660038281548110151561074957fe5b600091825260209091200154600160a060020a031614156107cf5760038054600019810190811061077657fe5b60009182526020909120015460038054600160a060020a03909216918390811061079c57fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055506107d7565b600101610722565b506003805460001901906107eb9082611557565b5060035460045411156108045760035461080490610f7b565b604051600160a060020a038316907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a25050565b3360008181526002602052604090205460ff16151561085a57600080fd5b60008281526001602090815260408083203380855292529091205483919060ff16151561088657600080fd5b600084815260208190526040902060030154849060ff16156108a757600080fd5b6000858152600160209081526040808320338085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b60055481101561099057838015610958575060008181526020819052604090206003015460ff16155b8061097c575082801561097c575060008181526020819052604090206003015460ff165b15610988576001820191505b60010161092f565b5092915050565b3330146109a357600080fd5b600160a060020a038116600090815260026020526040902054819060ff16156109cb57600080fd5b81600160a060020a03811615156109e157600080fd5b600380549050600101600454603282111580156109fe5750818111155b8015610a0957508015155b8015610a1457508115155b1515610a1f57600080fd5b600160a060020a038516600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b600354811015610b3b5760008481526001602052604081206003805491929184908110610aea57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610b1e576001820191505b600454821415610b3357600192505050610b3e565b600101610ac1565b50505b919050565b6000805b600354811015610bac5760008381526001602052604081206003805491929184908110610b7057fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610ba4576001820191505b600101610b47565b50919050565b6000602081815291815260409081902080546001808301546002808501805487516101009582161595909502600019011691909104601f8101889004880284018801909652858352600160a060020a0390931695909491929190830182828015610c5d5780601f10610c3257610100808354040283529160200191610c5d565b820191906000526020600020905b815481529060010190602001808311610c4057829003601f168201915b5050506003909301549192505060ff1684565b60606003805480602002602001604051908101604052809291908181526020018280548015610cc857602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610caa575b505050505090505b90565b606080600554604051908082528060200260200182016040528015610d02578160200160208202803883390190505b5090506000805b600554811015610d8457858015610d32575060008181526020819052604090206003015460ff16155b80610d565750848015610d56575060008181526020819052604090206003015460ff165b15610d7c57808383815181101515610d6a57fe5b60209081029091010152600191909101905b600101610d09565b878703604051908082528060200260200182016040528015610db0578160200160208202803883390190505b5093508790505b86811015610df9578281815181101515610dcd57fe5b9060200190602002015184898303815181101515610de757fe5b60209081029091010152600101610db7565b505050949350505050565b606080600380549050604051908082528060200260200182016040528015610e36578160200160208202803883390190505b5090506000805b600354811015610eee5760008581526001602052604081206003805491929184908110610e6657fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610ee6576003805482908110610ea157fe5b6000918252602090912001548351600160a060020a0390911690849084908110610ec757fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610e3d565b81604051908082528060200260200182016040528015610f18578160200160208202803883390190505b509350600090505b81811015610f6d578281815181101515610f3657fe5b906020019060200201518482815181101515610f4e57fe5b600160a060020a03909216602092830290910190910152600101610f20565b505050919050565b60055481565b333014610f8757600080fd5b6003548160328211801590610f9c5750818111155b8015610fa757508015155b8015610fb257508115155b1515610fbd57600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b3360008181526002602052604090205460ff16151561101857600080fd5b6000828152602081905260409020548290600160a060020a0316151561103d57600080fd5b60008381526001602090815260408083203380855292529091205484919060ff161561106857600080fd5b6000858152600160208181526040808420338086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a36110be85611289565b5050505050565b60006110d2848484611444565b90506110dd81610ffa565b9392505050565b603281565b60045481565b3330146110fb57600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561112457600080fd5b600160a060020a038216600090815260026020526040902054829060ff161561114c57600080fd5b82600160a060020a038116151561116257600080fd5b60005b6003548110156111ee5785600160a060020a031660038281548110151561118857fe5b600091825260209091200154600160a060020a031614156111e657846003828154811015156111b357fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055506111ee565b600101611165565b50600160a060020a03808616600081815260026020526040808220805460ff1990811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a2604051600160a060020a038516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b3360008181526002602052604090205460ff1615156112a757600080fd5b60008281526001602090815260408083203380855292529091205483919060ff1615156112d357600080fd5b600084815260208190526040902060030154849060ff16156112f457600080fd5b6112fd85610abc565b156110be576000858152602081815260409182902060038101805460ff19166001908117909155815481830154600280850180548851601f6000199783161561010002979097019091169290920494850187900487028201870190975283815293956113cf95600160a060020a039093169491939283908301828280156113c55780601f1061139a576101008083540402835291602001916113c5565b820191906000526020600020905b8154815290600101906020018083116113a857829003601f168201915b5050505050611534565b156114045760405186907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a261143c565b60405186907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038101805460ff191690555b505050505050565b600083600160a060020a038116151561145c57600080fd5b60055460408051608081018252600160a060020a0388811682526020808301898152838501898152600060608601819052878152808452959095208451815473ffffffffffffffffffffffffffffffffffffffff1916941693909317835551600183015592518051949650919390926114dc926002850192910190611580565b50606091909101516003909101805460ff191691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b6000806040516020840160008287838a8c6187965a03f198975050505050505050565b81548183558181111561157b5760008381526020902061157b9181019083016115fe565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106115c157805160ff19168380011785556115ee565b828001600101855582156115ee579182015b828111156115ee5782518255916020019190600101906115d3565b506115fa9291506115fe565b5090565b610cd091905b808211156115fa576000815560010161160456fea165627a7a7230582070d3c680a2cf749f81772e7fffa2883f27a13c65fcfff32190d7585b0c6f0ce40029", + "storage": { + "7aa07e0c924147697605046b7c2c32645b7bbfb41e0ac5d0a84ac93cbb759798": "0000000000000000000000000000000000000000000000000000000000000001", + "cea2b0602db61f92b76ec4402875cc38eedc9fc425cb1b697fc2265d50fc20fb": "0000000000000000000000000000000000000000000000000000000000000001", + "4f7a8a74534b9c49e702cc1608997068d9d949e24c4ac8b65a867a93993eb574": "0000000000000000000000000000000000000000000000000000000000000001", + "7d201a4b60b90e6e65c967735aab180eb29ed67526549c9d60e0a7c22b339e2c": "0000000000000000000000000000000000000000000000000000000000000001", + "909b6f325b0c24cd08059f0d7e8aa5f618b00a803b965b660ad4b525b5ae4d91": "0000000000000000000000000000000000000000000000000000000000000001", + "758b54389b1c1c8ffbddde85b1992fa51cc2e9e75beed4bdc2a0cf3791e8c481": "0000000000000000000000000000000000000000000000000000000000000001", + "0000000000000000000000000000000000000000000000000000000000000003": "0000000000000000000000000000000000000000000000000000000000000006", + "c2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b": "000000000000000000000000385a157f6cc00d980420e50cb2083054cea32e90", + "c2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c": "000000000000000000000000385bed87aa69123a53212d67c1119fe32e1619ab", + "c2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d": "00000000000000000000000038500f1002084341bf47ee913c4dc2cd92ede0ea", + "c2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e": "00000000000000000000000038505e728533bf27620601f396231edb2d7c3088", + "c2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85f": "000000000000000000000000385fd8e4eb6f360a1a76bf27bfc03f0fbfbd6ceb", + "c2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f860": "000000000000000000000000385ef55e292fa39cf5ffbad99f534294565519ba", + "0000000000000000000000000000000000000000000000000000000000000004": "0000000000000000000000000000000000000000000000000000000000000003" + }, + "version": "0x01" + } + }, + "number": "0x0", + "gasUsed": "0x0", + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" +}