How to use the @0x/contracts-staking.artifacts.StakingProxy 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 / contracts / integrations / src / deployment_mananger.ts View on Github external
const readOnlyProxy = await ReadOnlyProxyContract.deployFrom0xArtifactAsync(
            stakingArtifacts.ReadOnlyProxy,
            environment.provider,
            txDefaults,
            stakingArtifacts,
        );
        const stakingLogic = await TestStakingContract.deployFrom0xArtifactAsync(
            stakingArtifacts.TestStaking,
            environment.provider,
            txDefaults,
            stakingArtifacts,
            tokens.weth.address,
            tokens.zrx.address,
        );
        const stakingProxy = await StakingProxyContract.deployFrom0xArtifactAsync(
            stakingArtifacts.StakingProxy,
            environment.provider,
            txDefaults,
            stakingArtifacts,
            stakingLogic.address,
            readOnlyProxy.address,
        );
        const stakingWrapper = new TestStakingContract(stakingProxy.address, environment.provider);

        // Add the zrx vault and the weth contract to the staking proxy.
        await stakingWrapper.setWethContract.awaitTransactionSuccessAsync(tokens.weth.address, { from: owner });
        await stakingWrapper.setZrxVault.awaitTransactionSuccessAsync(zrxVault.address, { from: owner });

        // Authorize the owner address in the staking proxy and the zrx vault.
        await stakingProxy.addAuthorizedAddress.awaitTransactionSuccessAsync(owner, { from: owner });
        await zrxVault.addAuthorizedAddress.awaitTransactionSuccessAsync(owner, { from: owner });
github 0xProject / 0x-monorepo / packages / migrations / src / testnet_migrations.ts View on Github external
stakingArtifacts.Staking,
        provider,
        txDefaults,
        stakingArtifacts,
    );

    const exchange = await ExchangeContract.deployFrom0xArtifactAsync(
        exchangeArtifacts.Exchange,
        provider,
        txDefaults,
        exchangeArtifacts,
        chainId,
    );

    const stakingProxy = await StakingProxyContract.deployFrom0xArtifactAsync(
        stakingArtifacts.StakingProxy,
        provider,
        txDefaults,
        stakingArtifacts,
        stakingLogic.address,
    );

    const erc20BridgeProxy = await ERC20BridgeProxyContract.deployFrom0xArtifactAsync(
        assetProxyArtifacts.ERC20BridgeProxy,
        provider,
        txDefaults,
        assetProxyArtifacts,
    );

    await UniswapBridgeContract.deployFrom0xArtifactAsync(
        assetProxyArtifacts.UniswapBridge,
        provider,