How to use the @0x/contracts-staking.ZrxVaultContract.deployFrom0xArtifactAsync function in @0x/contracts-staking

To help you get started, we’ve selected a few @0x/contracts-staking examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 0xProject / 0x-monorepo / packages / migrations / src / migration.ts View on Github external
artifacts,
    );

    const erc20BridgeProxy = await ERC20BridgeProxyContract.deployFrom0xArtifactAsync(
        artifacts.ERC20BridgeProxy,
        provider,
        txDefaults,
        {},
    );
    await exchange.registerAssetProxy(erc20BridgeProxy.address).awaitTransactionSuccessAsync(txDefaults);
    await erc20BridgeProxy.addAuthorizedAddress(exchange.address).awaitTransactionSuccessAsync(txDefaults);
    await erc20BridgeProxy.addAuthorizedAddress(multiAssetProxy.address).awaitTransactionSuccessAsync(txDefaults);
    await multiAssetProxy.registerAssetProxy(erc20BridgeProxy.address).awaitTransactionSuccessAsync(txDefaults);

    const zrxProxy = erc20Proxy.address;
    const zrxVault = await ZrxVaultContract.deployFrom0xArtifactAsync(
        artifacts.ZrxVault,
        provider,
        txDefaults,
        {},
        zrxProxy,
        zrxToken.address,
    );

    // Note we use TestStakingContract as the deployed bytecode of a StakingContract
    // has the tokens hardcoded
    const stakingLogic = await TestStakingContract.deployFrom0xArtifactAsync(
        artifacts.Staking,
        provider,
        txDefaults,
        {},
        etherToken.address,
github 0xProject / 0x-monorepo / contracts / integrations / src / deployment_mananger.ts View on Github external
protected static async _deployStakingContractsAsync(
        environment: BlockchainTestsEnvironment,
        owner: string,
        txDefaults: Partial,
        tokens: TokenContracts,
        assetProxies: AssetProxyContracts,
    ): Promise {
        const zrxVault = await ZrxVaultContract.deployFrom0xArtifactAsync(
            stakingArtifacts.ZrxVault,
            environment.provider,
            txDefaults,
            stakingArtifacts,
            assetProxies.erc20Proxy.address,
            tokens.zrx.address,
        );
        const readOnlyProxy = await ReadOnlyProxyContract.deployFrom0xArtifactAsync(
            stakingArtifacts.ReadOnlyProxy,
            environment.provider,
            txDefaults,
            stakingArtifacts,
        );
        const stakingLogic = await TestStakingContract.deployFrom0xArtifactAsync(
            stakingArtifacts.TestStaking,
            environment.provider,