send_credits.sh 673 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. # send credits
  3. function send_credits {
  4. N=$1
  5. networks=(${N//,/ })
  6. P=$2
  7. pools=(${P//,/ })
  8. for network in "${networks[@]}"
  9. do
  10. for targetNetwork in "${networks[@]}"
  11. do
  12. if [[ $network == $targetNetwork ]]
  13. then
  14. continue
  15. fi
  16. for poolId in "${pools[@]}"
  17. do
  18. for dstPoolId in "${pools[@]}"
  19. do
  20. eval "npx hardhat --network ${network} sendCredits --pool-id ${poolId} --dst-pool-id ${dstPoolId} --target-networks ${targetNetwork}"
  21. done
  22. done
  23. done
  24. done
  25. }
  26. # usage: $ ./send_credits.sh bsctestnet-sandbox,fuji-sandbox 1,2,3
  27. send_credits $1 $2