-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from webb-tools/drew-native-token-wrapper
Add ability to wrap native assets into the token wrapper
- Loading branch information
Showing
15 changed files
with
36,575 additions
and
714 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ethers } from "ethers"; | ||
import { ERC20 as ERC20Contract} from '../../typechain/ERC20'; | ||
import { ERC20__factory } from "../../typechain/factories/ERC20__factory"; | ||
|
||
class ERC20 { | ||
contract: ERC20Contract; | ||
|
||
constructor( | ||
contract: ERC20Contract | ||
) { | ||
this.contract = contract; | ||
} | ||
|
||
public static async createERC20( | ||
name: string, | ||
symbol: string, | ||
deployer: ethers.Signer | ||
): Promise<ERC20> { | ||
const factory = new ERC20__factory(deployer); | ||
const contract = await factory.deploy( | ||
name, | ||
symbol, | ||
); | ||
await contract.deployed(); | ||
|
||
const handler = new ERC20(contract); | ||
return handler; | ||
} | ||
} | ||
|
||
export default ERC20; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { ethers } from "ethers"; | ||
import { GovernedTokenWrapper as GovernedTokenWrapperContract} from '../../typechain/GovernedTokenWrapper'; | ||
import { GovernedTokenWrapper__factory } from "../../typechain/factories/GovernedTokenWrapper__factory"; | ||
|
||
class GovernedTokenWrapper { | ||
contract: GovernedTokenWrapperContract; | ||
|
||
constructor( | ||
contract: GovernedTokenWrapperContract | ||
) { | ||
this.contract = contract; | ||
} | ||
|
||
public static async createGovernedTokenWrapper( | ||
name: string, | ||
symbol: string, | ||
governor: string, | ||
limit: string, | ||
isNativeAllowed: boolean, | ||
deployer: ethers.Signer | ||
) { | ||
const factory = new GovernedTokenWrapper__factory(deployer); | ||
const contract = await factory.deploy( | ||
name, | ||
symbol, | ||
governor, | ||
limit, | ||
isNativeAllowed | ||
); | ||
await contract.deployed(); | ||
|
||
const handler = new GovernedTokenWrapper(contract); | ||
return handler; | ||
} | ||
} | ||
|
||
export default GovernedTokenWrapper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.