Smart contracts that integrate with Umbra, but are not part of the core protocol contracts.
Below is a list of contracts contained in this package:
UmbraBatchSend
: Aggregate multipleUmbra
sends into a single transaction.
This repo uses Foundry.
- Inside
contracts-periphery
folder, runcp .env.example .env
and fill out all fields. - In your terminal use command
cast nonce <Deployer's address> --rpc-url <URL>
to find your nonce.
- Change
EXPECTED_NONCE
ofDeployBatchSend
script to match your nonce. - To make sure the script test passes, run
forge test --mc DeployBatchSendTest --sender <Deployer's address>
- Pass in the
private key
to dry run deploying the contract across the networks you've specified. You should see gas estimates for each network, otherwise there could be a mismatch between deployer's nonce and the specified expected nonce, or there's already code at the expected contract address.
forge script DeployBatchSend --private-key <Private Key>
- Execute the deploy by broadcasting the deploy transactions.
forge script DeployBatchSend --private-key <Private Key> --broadcast
- Inside
contracts-periphery
folder, runcp .env.example .env
and fill out all fields. - In your terminal use command
source .env
to load the environment variables. - To make sure the script test passes, run
forge test --mc ApproveBatchSendTokensTest --sender <Owner's address>
- To dry run the script pass in the
--private-key
flag and the desired network in the--rpc-url
flag. Contract and token addresses should be specific to the network specified in the--rpc-url
flag.
forge script ApproveBatchSendTokens --sig "run(address,address,address[])" <UmbraContractAddress> <UmbraBatchSendContractAddress> "[<TokenAddressToApprove>,<TokenAddressToApprove>]" --rpc-url $MAINNET_RPC_URL --private-key $PRIVATE_KEY
- Execute the script by adding the broadcasting flag.
forge script ApproveBatchSendTokens --sig "run(address,address,address[])" <UmbraContractAddress> <UmbraBatchSendContractAddress> "[<TokenAddressToApprove>,<SecondTokenAddressToApprove>]" --rpc-url $MAINNET_RPC_URL --private-key $PRIVATE_KEY --broadcast