@@ -34,13 +34,11 @@ contract FrontendMassMigration {
3434 pure
3535 returns (bytes memory )
3636 {
37- Tx.MassMigration[] memory txTxs = new Tx.MassMigration [](
38- encodedTxs.length
39- );
37+ Tx.MassMigration[] memory txTxs =
38+ new Tx.MassMigration [](encodedTxs.length );
4039 for (uint256 i = 0 ; i < txTxs.length ; i++ ) {
41- Offchain.MassMigration memory _tx = Offchain.decodeMassMigration (
42- encodedTxs[i]
43- );
40+ Offchain.MassMigration memory _tx =
41+ Offchain.decodeMassMigration (encodedTxs[i]);
4442 txTxs[i] = Tx.MassMigration (_tx.fromIndex, _tx.amount, _tx.fee);
4543 }
4644 return Tx.serialize (txTxs);
@@ -64,14 +62,10 @@ contract FrontendMassMigration {
6462 pure
6563 returns (bytes memory )
6664 {
67- Offchain.MassMigration memory _tx = Offchain.decodeMassMigration (
68- encodedTx
69- );
70- Tx.MassMigration memory txTx = Tx.MassMigration (
71- _tx.fromIndex,
72- _tx.amount,
73- _tx.fee
74- );
65+ Offchain.MassMigration memory _tx =
66+ Offchain.decodeMassMigration (encodedTx);
67+ Tx.MassMigration memory txTx =
68+ Tx.MassMigration (_tx.fromIndex, _tx.amount, _tx.fee);
7569 return Tx.massMigrationMessageOf (txTx, _tx.nonce, _tx.spokeID);
7670 }
7771
@@ -81,21 +75,14 @@ contract FrontendMassMigration {
8175 uint256 [4 ] calldata pubkey ,
8276 bytes32 domain
8377 ) external view returns (bool ) {
84- Offchain.MassMigration memory _tx = Offchain.decodeMassMigration (
85- encodedTx
86- );
78+ Offchain.MassMigration memory _tx =
79+ Offchain.decodeMassMigration (encodedTx);
8780 Tx.encodeDecimal (_tx.amount);
8881 Tx.encodeDecimal (_tx.fee);
89- Tx.MassMigration memory txTx = Tx.MassMigration (
90- _tx.fromIndex,
91- _tx.amount,
92- _tx.fee
93- );
94- bytes memory txMsg = Tx.massMigrationMessageOf (
95- txTx,
96- _tx.nonce,
97- _tx.spokeID
98- );
82+ Tx.MassMigration memory txTx =
83+ Tx.MassMigration (_tx.fromIndex, _tx.amount, _tx.fee);
84+ bytes memory txMsg =
85+ Tx.massMigrationMessageOf (txTx, _tx.nonce, _tx.spokeID);
9986
10087 bool callSuccess;
10188 bool checkSuccess;
@@ -122,9 +109,8 @@ contract FrontendMassMigration {
122109 Types.Result result
123110 )
124111 {
125- Offchain.MassMigration memory _tx = Offchain.decodeMassMigration (
126- encodedTx
127- );
112+ Offchain.MassMigration memory _tx =
113+ Offchain.decodeMassMigration (encodedTx);
128114 Types.UserState memory sender = Types.decodeState (senderEncoded);
129115 uint256 tokenID = sender.tokenID;
130116 (sender, result) = Transition.validateAndApplySender (
@@ -156,14 +142,14 @@ contract FrontendMassMigration {
156142 Types.Result result
157143 )
158144 {
159- Offchain.MassMigration memory offchainTx = Offchain. decodeMassMigration (
160- encodedTx
161- );
162- Tx.MassMigration memory _tx = Tx.MassMigration (
163- offchainTx.fromIndex,
164- offchainTx.amount,
165- offchainTx.fee
166- );
145+ Offchain.MassMigration memory offchainTx =
146+ Offchain. decodeMassMigration ( encodedTx);
147+ Tx.MassMigration memory _tx =
148+ Tx.MassMigration (
149+ offchainTx.fromIndex,
150+ offchainTx.amount,
151+ offchainTx.fee
152+ );
167153 return Transition.processMassMigration (stateRoot, _tx, tokenID, from);
168154 }
169155
@@ -176,13 +162,14 @@ contract FrontendMassMigration {
176162 uint256 spokeID ,
177163 bytes memory txs
178164 ) public view returns (Types.Result) {
179- Types.AuthCommon memory common = Types.AuthCommon ({
180- signature: signature,
181- stateRoot: stateRoot,
182- accountRoot: accountRoot,
183- domain: domain,
184- txs: txs
185- });
165+ Types.AuthCommon memory common =
166+ Types.AuthCommon ({
167+ signature: signature,
168+ stateRoot: stateRoot,
169+ accountRoot: accountRoot,
170+ domain: domain,
171+ txs: txs
172+ });
186173 return Authenticity.verifyMassMigration (common, proof, spokeID);
187174 }
188175}
0 commit comments