Skip to content

Commit

Permalink
use a different function name
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdavinchee committed Sep 21, 2023
1 parent 5f90091 commit 1f17c00
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interface ISuperToken is ISuperfluidToken, IERC20Metadata, IERC777 {
/**
* @dev Initialize the contract with admin override
*/
function initialize(
function initializeWithAdminOverride(
IERC20 underlyingToken,
uint8 underlyingDecimals,
string calldata n,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ contract SuperToken is
}

/// @dev Initialize the Super Token proxy with an admin override
function initialize(
function initializeWithAdminOverride(
IERC20 underlyingToken,
uint8 underlyingDecimals,
string calldata n,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ abstract contract SuperTokenFactoryBase is
}

// initialize the token
superToken.initialize(
superToken.initializeWithAdminOverride(
underlyingToken,
underlyingDecimals,
name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,7 @@ describe("SuperToken's Non Standard Functions", function () {

it("#1.4 only can initialize once", async () => {
await expectRevertedWith(
superToken["initialize(address,uint8,string,string)"](
ZERO_ADDRESS,
18,
"name",
"symbol"
),
superToken.initialize(ZERO_ADDRESS, 18, "name", "symbol"),
"Initializable: contract is already initialized"
);
});
Expand Down Expand Up @@ -751,10 +746,12 @@ describe("SuperToken's Non Standard Functions", function () {
customToken,
reason
);
await web3tx(
customToken["initialize(address,uint8,string,string)"],
"customToken.initialize"
)(ZERO_ADDRESS, 0, "Custom SuperTestToken", "CSTT");
await web3tx(customToken.initialize, "customToken.initialize")(
ZERO_ADDRESS,
0,
"Custom SuperTestToken",
"CSTT"
);

await web3tx(customToken.selfMint, "customToken.selfMint")(
alice,
Expand Down Expand Up @@ -784,7 +781,7 @@ describe("SuperToken's Non Standard Functions", function () {

it("#3.4 Custom token can use selfTransferFrom", async () => {
console.log("customToken.initialize");
await customToken["initialize(address,uint8,string,string)"](
await customToken.initialize(
ZERO_ADDRESS,
0,
"Custom SuperTestToken",
Expand Down Expand Up @@ -863,10 +860,12 @@ describe("SuperToken's Non Standard Functions", function () {
});

it("#3.5 Custom token can use selfApproveFor", async () => {
await web3tx(
customToken["initialize(address,uint8,string,string)"],
"customToken.initialize"
)(ZERO_ADDRESS, 0, "Custom SuperTestToken", "CSTT");
await web3tx(customToken.initialize, "customToken.initialize")(
ZERO_ADDRESS,
0,
"Custom SuperTestToken",
"CSTT"
);

await web3tx(customToken.selfMint, "customToken.selfMint")(
alice,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,7 @@ describe("SuperTokenFactory Contract", function () {
);

await expectRevertedWith(
superTokenLogic["initialize(address,uint8,string,string)"](
ZERO_ADDRESS,
0,
"",
""
),
superTokenLogic.initialize(ZERO_ADDRESS, 0, "", ""),
"Initializable: contract is already initialized"
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ contract FoundrySuperfluidTester is Test {
previousSuperToken.CONSTANT_OUTFLOW_NFT(),
previousSuperToken.CONSTANT_INFLOW_NFT()
);
localSuperToken.initialize(underlyingToken, underlyingDecimals, name, symbol, adminOverride);
localSuperToken.initializeWithAdminOverride(underlyingToken, underlyingDecimals, name, symbol, adminOverride);
}

// Write Helpers - ConstantFlowAgreementV1
Expand Down

0 comments on commit 1f17c00

Please sign in to comment.