Пример #1
0
    def deploy(web3: Web3,
               admin: Address,
               fee_account: Address,
               account_levels_addr: Address,
               fee_make: Wad,
               fee_take: Wad,
               fee_rebate: Wad,
               api_server: str):
        """Deploy a new instance of the `EtherDelta` contract.

        Args:
            web3: An instance of `Web` from `web3.py`.
            api_server: Base URL of the `EtherDelta` API server (for off-chain order support etc.).
                `None` if no off-chain order support desired.

        Returns:
            A `EtherDelta` class instance.
        """
        return EtherDelta(web3=web3,
                          address=Contract._deploy(web3, EtherDelta.abi, EtherDelta.bin, [
                              admin.address,
                              fee_account.address,
                              account_levels_addr.address,
                              fee_make.value,
                              fee_take.value,
                              fee_rebate.value
                          ]),
                          api_server=api_server)
Пример #2
0
 def deploy(web3: Web3, jar: Address, jug: Address, pot: Address, pit: Address, tip: Address):
     assert(isinstance(jar, Address))
     assert(isinstance(jug, Address))
     assert(isinstance(pot, Address))
     assert(isinstance(pit, Address))
     assert(isinstance(tip, Address))
     return Tub(web3=web3, address=Contract._deploy(web3, Tub.abiTub, Tub.binTub,
                                                    [jar.address, jug.address, pot.address, pit.address, tip.address]))
Пример #3
0
    def deploy(web3: Web3):
        """Deploy a new instance of the `DSEthToken` contract.

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

        Returns:
            A `DSEthToken` class instance.
        """
        return DSEthToken(web3=web3, address=Contract._deploy(web3, DSEthToken.abi, DSEthToken.bin, []))
Пример #4
0
    def deploy(web3: Web3):
        """Deploy a new instance of the `SimpleMarket` contract.

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

        Returns:
            A `SimpleMarket` class instance.
        """
        return SimpleMarket(web3=web3,
                            address=Contract._deploy(web3, SimpleMarket.abi,
                                                     SimpleMarket.bin, []))
Пример #5
0
    def deploy(web3: Web3, symbol: str):
        """Deploy a new instance of the `DSToken` contract.

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

        Returns:
            A `DSToken` class instance.
        """
        assert(isinstance(symbol, str))
        return DSToken(web3=web3, address=Contract._deploy(web3, DSToken.abi, DSToken.bin, [symbol]))
Пример #6
0
    def deploy(web3: Web3, close_time: int):
        """Deploy a new instance of the `MatchingMarket` contract.

        Args:
            web3: An instance of `Web` from `web3.py`.
            close_time: Unix timestamp of when the market will close.

        Returns:
            A `MatchingMarket` class instance.
        """
        return MatchingMarket(web3=web3,
                              address=Contract._deploy(web3,
                                                       MatchingMarket.abi,
                                                       MatchingMarket.bin,
                                                       [close_time]))
Пример #7
0
 def deploy(web3: Web3):
     return DSRoles(web3=web3, address=Contract._deploy(web3, DSRoles.abi, DSRoles.bin, []))
Пример #8
0
 def deploy(web3: Web3):
     return DSGuard(web3=web3, address=Contract._deploy(web3, DSGuard.abi, DSGuard.bin, []))
Пример #9
0
 def deploy(web3: Web3):
     return TxManager(web3=web3,
                      address=Contract._deploy(web3, TxManager.abi,
                                               TxManager.bin, []))
Пример #10
0
 def deploy(web3: Web3, tub: Address, tap: Address):
     assert (isinstance(tub, Address))
     assert (isinstance(tap, Address))
     return Top(web3=web3,
                address=Contract._deploy(web3, Top.abi, Top.bin,
                                         [tub.address, tap.address]))
Пример #11
0
 def deploy(web3: Web3, tub: Address, pit: Address):
     assert (isinstance(tub, Address))
     assert (isinstance(pit, Address))
     return Tap(web3=web3,
                address=Contract._deploy(web3, Tap.abi, Tap.bin,
                                         [tub.address, pit.address]))
Пример #12
0
 def deploy(web3: Web3):
     return DSValue(web3=web3,
                    address=Contract._deploy(web3, DSValue.abi, DSValue.bin,
                                             []))