diff --git a/contracts/src/SimpleBettingGame.sol b/contracts/src/SimpleBettingGame.sol index 504d896..d3dbcc0 100644 --- a/contracts/src/SimpleBettingGame.sol +++ b/contracts/src/SimpleBettingGame.sol @@ -76,7 +76,7 @@ contract SimpleBettingGame is VRFConsumerBaseV2, ReentrancyGuard { IVRFProxy internal immutable _vrfCoordinator; uint64 public immutable vrfSubscriptionID; bytes32 public immutable vrfKeyHash; - uint32 public constant VRF_CALLBACK_GAS_LIMIT = 100_000; + uint32 public constant VRF_CALLBACK_GAS_LIMIT = 200_000; uint32 public constant MAX_VALUE = 100; /** diff --git a/contracts/src/VRFProvider.sol b/contracts/src/VRFProvider.sol index 3b1bffa..a31e54d 100644 --- a/contracts/src/VRFProvider.sol +++ b/contracts/src/VRFProvider.sol @@ -66,9 +66,9 @@ contract VRFProvider is VRFConsumerBaseV2, TeleporterOwnerUpgradeable, Reentranc * @dev Gas limits for receiving random words from the Chainlink VRF coordinator, and sending * them in a Teleporter message to the partner Teleporter VRF coordinator contract. */ - uint32 public constant TELEPORTER_CALLBACK_GAS_LIMIT_BASE = 100_000; - uint32 public constant TELEPORTER_CALLBACK_GAS_LIMIT_PER_WORD = 1_000; - uint32 public constant TELEPORTER_RECEIVE_MESSAGE_GAS_OVERHEAD = 20_000; + uint32 public constant TELEPORTER_CALLBACK_GAS_LIMIT_BASE = 300_000; + uint32 public constant TELEPORTER_CALLBACK_GAS_LIMIT_PER_WORD = 5_000; + uint32 public constant TELEPORTER_RECEIVE_MESSAGE_GAS_OVERHEAD = 300_000; /** * @dev Emitted when a message is received from the partner VRFProxy requesting random values. diff --git a/contracts/src/VRFProxy.sol b/contracts/src/VRFProxy.sol index cf6f406..ee37678 100644 --- a/contracts/src/VRFProxy.sol +++ b/contracts/src/VRFProxy.sol @@ -37,7 +37,7 @@ contract VRFProxy is IVRFProxy, ReentrancyGuard, TeleporterOwnerUpgradeable { * @dev The estimated amount of gas used by the VRFProvider on the partner chain to request random values from the * Chainlink VRF coordinator. This is the required gas limit for the Teleporter message sent to request the values. */ - uint256 public constant VRF_REQUEST_REQUIRED_GAS = 100_000; + uint256 public constant VRF_REQUEST_REQUIRED_GAS = 500_000; /** * @dev The blockchain ID of the partner blockchain where the VRFProvider contract is deployed. diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 04fbab2..b8c7146 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -24,19 +24,31 @@ vrf_proxy_address=$(parseComputedContractAddress "$computed_proxy_contract_addre # Deploy the VRFProvider contract to the C-chain. cd $REPO_BASE_PATH/contracts +echo "Deploying VRFProvider to C-chain..." forge create --private-key $user_private_key \ src/VRFProvider.sol:VRFProvider \ --constructor-args $c_chain_teleporter_registry_address $c_chain_vrf_coordinator_address $subnet_blockchain_id $vrf_proxy_address \ - --rpc-url $c_chain_url + --rpc-url $c_chain_url > /dev/null +echo "Deployed VRFProvider to C-chain." # Deploy the VRFProxy contract to the Subnet. +echo "Deploying VRFProxy to Subnet..." forge create --private-key $user_private_key \ src/VRFProxy.sol:VRFProxy \ --constructor-args $subnet_teleporter_registry_address $c_chain_blockchain_id $vrf_provider_address \ - --rpc-url $subnet_url + --rpc-url $subnet_url > /dev/null +echo "Deployed VRFProxy to Subnet." # Deploy the SimpleBettingGame on the Subnet. -forge create --private-key $user_private_key \ +echo "Deploying SimpleBettingGame to Subnet..." +simple_betting_game_deploy_result=$(forge create --private-key $user_private_key \ src/SimpleBettingGame.sol:SimpleBettingGame \ --constructor-args $vrf_proxy_address $c_chain_vrf_subscription_id $c_chain_vrf_key_hash \ - --rpc-url $subnet_url + --rpc-url $subnet_url) +simple_betting_game_address=$(parseContractAddress "$simple_betting_game_deploy_result") +echo "Deployed SimpleBettingGame to Subnet." + +echo "Finished deploying contracts." +echo "C-chain VRFProvider: $vrf_provider_address" +echo "Subnet VRFProxy: $vrf_proxy_address" +echo "Subnet SimpleBettingGame: $simple_betting_game_address"