示例#1
0
    def deploy(web3: Web3):
        """Deploy a new instance of the `DSVault` contract.

        Args:
            web3: An instance of `Web` from `web3.py`.

        Returns:
            A `DSVault` class instance.
        """
        return DSVault(web3=web3,
                       address=Contract._deploy(web3, DSVault.abi, DSVault.bin,
                                                []))
示例#2
0
    def deploy(web3: Web3, zrx_asset: str):
        """Deploy a new instance of the 0x `Exchange` contract.

        Args:
            web3: An instance of `Web` from `web3.py`.
            zrx_token: The address of the ZRX token this exchange will use.

        Returns:
            A `ZrxExchange` class instance.
        """
        return ZrxExchangeV2(web3=web3,
                             address=Contract._deploy(web3, ZrxExchangeV2.abi,
                                                      ZrxExchangeV2.bin, []))
示例#3
0
    def deploy(web3: Web3, name: str, symbol: str):
        """Deploy a new instance of the `DSToken` contract.

        Args:
            web3: An instance of `Web` from `web3.py`.
            name: Name of the new token.
            symbol: Symbol of the new token.

        Returns:
            A `DSToken` class instance.
        """
        assert (isinstance(name, str))
        assert (isinstance(symbol, str))
        return DSToken(web3=web3,
                       address=Contract._deploy(
                           web3, DSToken.abi, DSToken.bin,
                           [bytes(name, "utf-8"),
                            bytes(symbol, "utf-8")]))
示例#4
0
 def deploy(web3: Web3, delay: int, owner: Address, ds_auth: DSAuth):
     return DSPause(web3=web3, address=Contract._deploy(web3, DSPause.abi, DSPause.bin,
                                                        [delay, owner.address, ds_auth.address.address]))
示例#5
0
 def deploy(web3: Web3):
     return TxManager(web3=web3, address=Contract._deploy(web3, TxManager.abi, TxManager.bin, []))
示例#6
0
 def deploy(web3: Web3):
     return DSValue(web3=web3,
                    address=Contract._deploy(web3, DSValue.abi, DSValue.bin,
                                             []))
示例#7
0
 def deploy(cls, web3: Web3):
     return cls(web3=web3,
                address=Contract._deploy(web3, cls.abi, cls.bin, []))
示例#8
0
 def deploy(cls, web3: Web3, cache: Address):
     return cls(web3=web3,
                address=Contract._deploy(web3, cls.abi, cls.bin,
                                         [cache.address]))
示例#9
0
 def deploy(web3: Web3):
     return DSAuth(web3=web3,
                   address=Contract._deploy(web3, DSAuth.abi, DSAuth.bin,
                                            []))
示例#10
0
 def deploy(web3: Web3):
     return DSGuard(web3=web3,
                    address=Contract._deploy(web3, DSGuard.abi, DSGuard.bin,
                                             []))