@@ -39,6 +39,7 @@ import {SequenceRegistry} from "evk/SequenceRegistry/SequenceRegistry.sol";
3939
4040struct Asset {
4141 string symbol;
42+ uint8 decimals;
4243 address asset;
4344 address vault;
4445 string price;
@@ -174,6 +175,7 @@ contract DeployScenario is Script {
174175 Asset memory a;
175176
176177 a.symbol = symbol;
178+ a.decimals = decimals;
177179 a.asset = address (new TestERC20 (string (abi.encodePacked (symbol, " Token " )), symbol, decimals, false ));
178180 a.vault = factory.createProxy (address (0 ), true , abi.encodePacked (a.asset, address (oracle), unitOfAccount));
179181 a.price = price;
@@ -243,6 +245,37 @@ contract DeployScenario is Script {
243245
244246 vm.writeLine (pricesFile, "} " );
245247 }
248+
249+ {
250+ string memory tokenListFile = "./dev-ctx/tokenlist/31337/tokenList.json " ;
251+ vm.writeLine (tokenListFile, "[ " );
252+
253+ for (uint256 i; i < assets.length ; ++ i) {
254+ vm.writeLine (tokenListFile, " { " );
255+
256+ vm.writeLine (tokenListFile, " \" chainId \" : 31337, " );
257+ vm.writeLine (tokenListFile, string (abi.encodePacked (" \" address \" : \" " , vm.toString (assets[i].asset), "\" , " )));
258+ vm.writeLine (tokenListFile, string (abi.encodePacked (" \" symbol \" : \" " , assets[i].symbol, "\" , " )));
259+ vm.writeLine (tokenListFile, string (abi.encodePacked (" \" decimals \" : " , vm.toString (assets[i].decimals))));
260+
261+ vm.writeLine (tokenListFile, string (abi.encodePacked (" } " , (i == assets.length - 1 ? "" : ", " ))));
262+ /*
263+ string memory line = string(
264+ abi.encodePacked(
265+ "\"",
266+ vm.toString(assets[i].asset),
267+ "\": {\"price\":",
268+ assets[i].price,
269+ "}",
270+ (i == assets.length - 1 ? "" : ",")
271+ )
272+ );
273+ vm.writeLine(pricesFile, line);
274+ */
275+ }
276+
277+ vm.writeLine (tokenListFile, "] " );
278+ }
246279 }
247280
248281 function getSubaccount (address user , uint8 account ) internal pure returns (address ) {
0 commit comments