Repository: hashgraph/hedera-services
Issue: Account with positive balance must be created via a cryptoCreate

**Summary of the defect**
https://github.com/hashgraph/hedera-services/blob/1308f994ba95d4d76c004b319aafa33fa2fcac67/hedera-node/src/main/java/com/hedera/services/state/initialization/BackedSystemAccountsCreator.java#L81-L104

Only `GENESIS` account (also called `treasury` account) is created with `totalTinyBarFloat` during genesis.

Changed files:
hedera-node/src/main/java/com/hedera/services/state/initialization/BackedSystemAccountsCreator.java
hedera-node/src/test/java/com/hedera/services/state/initialization/BackedSystemAccountsCreatorTest.java

diff --git a/hedera-node/src/main/java/com/hedera/services/state/initialization/BackedSystemAccountsCreator.java b/hedera-node/src/main/java/com/hedera/services/state/initialization/BackedSystemAccountsCreator.java
index 6b8966e04d..3b3b1e59bf 100644
--- a/hedera-node/src/main/java/com/hedera/services/state/initialization/BackedSystemAccountsCreator.java
+++ b/hedera-node/src/main/java/com/hedera/services/state/initialization/BackedSystemAccountsCreator.java
@@ -31,7 +31,6 @@ import com.hedera.services.legacy.core.jproto.JKey;
 import com.hedera.services.exceptions.NegativeAccountBalanceException;
 import com.hedera.services.state.merkle.MerkleAccount;
 import com.hedera.services.state.merkle.MerkleEntityId;
-import com.hedera.services.utils.MiscUtils;
 import com.hederahashgraph.api.proto.java.AccountID;
 import com.hederahashgraph.api.proto.java.Key;
 import com.hederahashgraph.api.proto.java.KeyList;
@@ -78,16 +77,9 @@ public class BackedSystemAccountsCreator implements SystemAccountsCreator {
 			BackingStore<AccountID, MerkleAccount> accounts,
 			AddressBook addressBook
 	) {
-		var nodeAccountNums = MiscUtils.getNodeAccountNums(addressBook);
-
 		long N = properties.getIntProperty("ledger.numSystemAccounts");
 		long expiry = properties.getLongProperty("bootstrap.system.entityExpiry");
 		long tinyBarFloat = properties.getLongProperty("ledger.totalTinyBarFloat");
-		long nodeBalance = properties.getLongProperty("bootstrap.ledger.nodeAccounts.initialBalance");
-		long defaultBalance = properties.getLongProperty("bootstrap.ledger.systemAccounts.initialBalance");
-		long treasuryBalance = tinyBarFloat
-				- (nodeBalance * nodeAccountNums.size())
-				- (defaultBalance * (N - nodeAccountNums.size() - 1));
 
 		for (long num = 1; num <= N; num++) {
 			var id = idWith(num);
@@ -95,11 +87,9 @@ public class BackedSystemAccountsCreator implements SystemAccountsCreator {
 				continue;
 			}
 			if (num == accountNums.treasury()) {
-				accounts.put(id, accountWith(treasuryBalance, expiry));
-			} else if (nodeAccountNums.contains(num)) {
-				accounts.put(id, accountWith(nodeBalance, expiry));
+				accounts.put(id, accountWith(tinyBarFloat, expiry));
 			} else {
-				accounts.put(id, accountWith(defaultBalance, expiry));
+				accounts.put(id, accountWith(0, expiry));
 			}
 		}
 
diff --git a/hedera-node/src/test/java/com/hedera/services/state/initialization/BackedSystemAccountsCreatorTest.java b/hedera-node/src/test/java/com/hedera/services/state/initialization/BackedSystemAccountsCreatorTest.java
index 3e25e5ba55..3fc2e0d1fa 100644
--- a/hedera-node/src/test/java/com/hedera/services/state/initialization/BackedSystemAccountsCreatorTest.java
+++ b/hedera-node/src/test/java/com/hedera/services/state/initialization/BackedSystemAccountsCreatorTest.java
@@ -58,10 +58,7 @@ import static org.mockito.Mockito.verify;
 class BackedSystemAccountsCreatorTest {
 	private long shard = 1;
 	private long realm = 2;
-	private long nodeBalance = 10l;
-	private long stdBalance = 5l;
-	private long treasuryBalance = 80l;
-	private long recordThresholds = 100l;
+	private long totalBalance = 100l;
 	private long expiry = Instant.now().getEpochSecond() + 1_234_567L;
 	private int numAccounts = 4;
 	private String b64Loc = "somewhere";
@@ -98,11 +95,7 @@ class BackedSystemAccountsCreatorTest {
 		given(properties.getIntProperty("ledger.numSystemAccounts"))
 				.willReturn(numAccounts);
 		given(properties.getLongProperty("ledger.totalTinyBarFloat"))
-				.willReturn(100L);
-		given(properties.getLongProperty("bootstrap.ledger.nodeAccounts.initialBalance"))
-				.willReturn(10L);
-		given(properties.getLongProperty("bootstrap.ledger.systemAccounts.initialBalance"))
-				.willReturn(5L);
+				.willReturn(totalBalance);
 		given(properties.getStringProperty("bootstrap.genesisB64Keystore.keyName"))
 				.willReturn(legacyId);
 		given(properties.getStringProperty("bootstrap.genesisB64Keystore.path"))
@@ -122,10 +115,10 @@ class BackedSystemAccountsCreatorTest {
 				accountWith(2),
 				accountWith(3),
 				accountWith(4)));
-		given(backingAccounts.getUnsafeRef(accountWith(1))).willReturn(withExpectedBalance(stdBalance));
-		given(backingAccounts.getUnsafeRef(accountWith(2))).willReturn(withExpectedBalance(treasuryBalance));
-		given(backingAccounts.getUnsafeRef(accountWith(3))).willReturn(withExpectedBalance(nodeBalance));
-		given(backingAccounts.getUnsafeRef(accountWith(4))).willReturn(withExpectedBalance(stdBalance));
+		given(backingAccounts.getUnsafeRef(accountWith(1))).willReturn(withExpectedBalance(0));
+		given(backingAccounts.getUnsafeRef(accountWith(2))).willReturn(withExpectedBalance(totalBalance));
+		given(backingAccounts.getUnsafeRef(accountWith(3))).willReturn(withExpectedBalance(0));
+		given(backingAccounts.getUnsafeRef(accountWith(4))).willReturn(withExpectedBalance(0));
 
 		subject = new BackedSystemAccountsCreator(
 				hederaNums,
@@ -136,11 +129,11 @@ class BackedSystemAccountsCreatorTest {
 
 	@Test
 	public void throwsOnNegativeBalance() {
-		givenMissingNode();
+		givenMissingTreasury();
 		// and:
 		given(legacyReader.hexedABytesFrom(b64Loc, legacyId)).willReturn(hexedABytes);
 		// and:
-		given(properties.getLongProperty("bootstrap.ledger.nodeAccounts.initialBalance"))
+		given(properties.getLongProperty("ledger.totalTinyBarFloat"))
 				.willReturn(-100L);
 
 		// expect:
@@ -177,7 +170,7 @@ class BackedSystemAccountsCreatorTest {
 		subject.ensureSystemAccounts(backingAccounts, book);
 
 		// then:
-		verify(backingAccounts).put(accountWith(3), withExpectedBalance(nodeBalance));
+		verify(backingAccounts).put(accountWith(3), withExpectedBalance(0));
 	}
 
 	@Test
@@ -190,7 +183,7 @@ class BackedSystemAccountsCreatorTest {
 		subject.ensureSystemAccounts(backingAccounts, book);
 
 		// then:
-		verify(backingAccounts).put(accountWith(4), withExpectedBalance(stdBalance));
+		verify(backingAccounts).put(accountWith(4), withExpectedBalance(0));
 	}
 
 	@Test
@@ -203,7 +196,7 @@ class BackedSystemAccountsCreatorTest {
 		subject.ensureSystemAccounts(backingAccounts, book);
 
 		// then:
-		verify(backingAccounts).put(accountWith(2), withExpectedBalance(treasuryBalance));
+		verify(backingAccounts).put(accountWith(2), withExpectedBalance(totalBalance));
 	}
 
 	@Test
@@ -231,7 +224,7 @@ class BackedSystemAccountsCreatorTest {
 		verify(backingAccounts, never()).put(any(), any());
 		// and:
 		verify(BackedSystemAccountsCreator.log).info(String.format(
-				"Ledger float is %d tinyBars in %d accounts.", 100, 4));
+				"Ledger float is %d tinyBars in %d accounts.", totalBalance, 4));
 
 		// cleanup:
 		BackedSystemAccountsCreator.log = LogManager.getLogger(BackedSystemAccountsCreator.class);