File tree 2 files changed +69
-1
lines changed
contracts/apps/ucs/03-zkgm 2 files changed +69
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ contract ZkgmERC20 is
26
26
27
27
struct ZkgmERC20Storage {
28
28
address minter;
29
+ string name;
30
+ string symbol;
29
31
uint8 decimals;
30
32
}
31
33
@@ -66,9 +68,29 @@ contract ZkgmERC20 is
66
68
__ERC20_init (_name, _symbol);
67
69
ZkgmERC20Storage storage $ = _getZkgmERC20Storage ();
68
70
$.minter = _minter;
71
+ $.name = _name;
72
+ $.symbol = _symbol;
69
73
$.decimals = _decimals;
70
74
}
71
75
76
+ function name ()
77
+ public
78
+ view
79
+ override (ERC20Upgradeable , IERC20Metadata )
80
+ returns (string memory )
81
+ {
82
+ return _getZkgmERC20Storage ().name;
83
+ }
84
+
85
+ function symbol ()
86
+ public
87
+ view
88
+ override (ERC20Upgradeable , IERC20Metadata )
89
+ returns (string memory )
90
+ {
91
+ return _getZkgmERC20Storage ().symbol;
92
+ }
93
+
72
94
function decimals ()
73
95
public
74
96
view
@@ -86,6 +108,17 @@ contract ZkgmERC20 is
86
108
_burn (from, amount);
87
109
}
88
110
111
+ function setMetadata (
112
+ string calldata _name ,
113
+ string calldata _symbol ,
114
+ uint8 _decimals
115
+ ) external restricted {
116
+ ZkgmERC20Storage storage $ = _getZkgmERC20Storage ();
117
+ $.name = _name;
118
+ $.symbol = _symbol;
119
+ $.decimals = _decimals;
120
+ }
121
+
89
122
modifier onlyMinter () {
90
123
if (msg .sender != _getZkgmERC20Storage ().minter) {
91
124
revert ERC20Unauthorized ();
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ import "./Deployer.sol";
27
27
28
28
library LIB {
29
29
string constant MULTICALL = "lib/multicall-v2 " ;
30
- string constant ZKGM_ERC20 = "lib/zkgm-erc20 " ;
30
+ string constant ZKGM_ERC20 = "lib/zkgm-erc20-v2 " ;
31
31
}
32
32
33
33
library IBC {
@@ -482,6 +482,41 @@ contract DeployStateLensIcs23MptClient is UnionScript {
482
482
}
483
483
}
484
484
485
+ contract DeployZkgmERC20 is UnionScript {
486
+ using LibString for * ;
487
+
488
+ address immutable deployer;
489
+ address immutable sender;
490
+
491
+ constructor () {
492
+ deployer = vm.envAddress ("DEPLOYER " );
493
+ sender = vm.envAddress ("SENDER " );
494
+ }
495
+
496
+ function getDeployer () internal view override returns (Deployer) {
497
+ return Deployer (deployer);
498
+ }
499
+
500
+ function getDeployed (
501
+ string memory salt
502
+ ) internal view returns (address ) {
503
+ return CREATE3.predictDeterministicAddress (
504
+ keccak256 (abi.encodePacked (sender.toHexString (), "/ " , salt)),
505
+ deployer
506
+ );
507
+ }
508
+
509
+ function run () public {
510
+ uint256 privateKey = vm.envUint ("PRIVATE_KEY " );
511
+
512
+ vm.startBroadcast (privateKey);
513
+ ZkgmERC20 zkgmERC20 = deployZkgmERC20 ();
514
+ vm.stopBroadcast ();
515
+
516
+ console.log ("ZkgmERC20: " , address (zkgmERC20));
517
+ }
518
+ }
519
+
485
520
contract DeployUCS03 is UnionScript {
486
521
using LibString for * ;
487
522
You can’t perform that action at this time.
0 commit comments