Skip to content

Commit

Permalink
chore: concat strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed May 22, 2024
1 parent 1a8c774 commit c2d9f9b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/RoleManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,21 @@ contract RoleManager is Positions {
// Append the rollup ID for the name and symbol of custom vaults.
string memory _id = _rollupID == ORIGIN_NETWORK_ID
? ""
: string(abi.encodePacked("-", Strings.toString(_rollupID)));
: string.concat("-", Strings.toString(_rollupID));

// Name is "{SYMBOL}-STB yVault"
string memory _name = string(
abi.encodePacked(ERC20(_asset).symbol(), "-STB", _id, " yVault")
string memory _name = string.concat(
ERC20(_asset).symbol(),
"-STB",
_id,
" yVault"
);

// Symbol is "stb{SYMBOL}".
string memory _symbol = string(
abi.encodePacked("stb", ERC20(_asset).symbol(), _id)
string memory _symbol = string.concat(
"stb",
ERC20(_asset).symbol(),
_id
);

// Deploy through the registry so it is automatically endorsed.
Expand Down
2 changes: 2 additions & 0 deletions test/L1Deployer.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ contract L1DeployerTest is Setup {

IVault vault = IVault(_vault);

assertEq(vault.name(), "DAI-STB yVault");
assertEq(vault.symbol(), "stbDAI");
assertEq(vault.accountant(), address(accountant));
assertEq(vault.asset(), address(asset));
assertEq(vault.deposit_limit(), 2 ** 256 - 1);
Expand Down

0 comments on commit c2d9f9b

Please sign in to comment.