Skip to content

Commit

Permalink
Bump Teleporter submodule to v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkaplan13 committed Feb 14, 2024
1 parent d519116 commit c008b4a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion contracts/lib/teleporter
4 changes: 2 additions & 2 deletions contracts/remappings.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@chainlink/=lib/chainlink/
@openzeppelin/=lib/openzeppelin-contracts/
@openzeppelin/[email protected]/=lib/openzeppelin-contracts/contracts/
@teleporter/=lib/teleporter/
@subnet-evm-contracts/=lib/teleporter/contracts/lib/subnet-evm/contracts/contracts/
@avalabs/subnet-evm-contracts@1.2.0/=lib/teleporter/contracts/lib/subnet-evm/contracts/
2 changes: 1 addition & 1 deletion contracts/src/SimpleBettingGame.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pragma solidity 0.8.18;

import {VRFConsumerBaseV2} from "@chainlink/contracts/src/v0.8/vrf/VRFConsumerBaseV2.sol";
import {IVRFProxy} from "./IVRFProxy.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts@4.8.1/security/ReentrancyGuard.sol";

/**
* THIS IS AN EXAMPLE CONTRACT THAT USES UNAUDITED CODE.
Expand Down
9 changes: 5 additions & 4 deletions contracts/src/VRFProvider.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
TeleporterMessageInput, TeleporterFeeInfo
} from "@teleporter/contracts/src/Teleporter/ITeleporterMessenger.sol";
import {TeleporterOwnerUpgradeable} from "@teleporter/contracts/src/Teleporter/upgrades/TeleporterOwnerUpgradeable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {VRFConsumerBaseV2} from "@chainlink/contracts/src/v0.8/vrf/VRFConsumerBaseV2.sol";
import {VRFCoordinatorV2Interface} from "@chainlink/contracts/src/v0.8/vrf/interfaces/VRFCoordinatorV2Interface.sol";

Expand All @@ -30,7 +29,7 @@ import {VRFCoordinatorV2Interface} from "@chainlink/contracts/src/v0.8/vrf/inter
* to pay for the request. The partner VRFProxy contract and all of its allowed consumers are able to use any
* subscription ID the VRFProvider has access to.
*/
contract VRFProvider is VRFConsumerBaseV2, TeleporterOwnerUpgradeable, ReentrancyGuard {
contract VRFProvider is VRFConsumerBaseV2, TeleporterOwnerUpgradeable {
/**
* @dev The components of VRFRequestInfo that need to be persisted when requesting
* random values from the Chainlink VRF coordinator. These values will be sent
Expand Down Expand Up @@ -96,7 +95,10 @@ contract VRFProvider is VRFConsumerBaseV2, TeleporterOwnerUpgradeable, Reentranc
address chainlinkVRFCoordinatorAddress_,
bytes32 vrfProxyBlockchainID_,
address vrfProxyAddress_
) TeleporterOwnerUpgradeable(teleporterRegistryAddress_) VRFConsumerBaseV2(chainlinkVRFCoordinatorAddress_) {
)
TeleporterOwnerUpgradeable(teleporterRegistryAddress_, msg.sender)
VRFConsumerBaseV2(chainlinkVRFCoordinatorAddress_)
{
require(vrfProxyAddress_ != address(0), "VRFProvider: zero VRF proxy address");
_chainlinkVRFCoordinator = VRFCoordinatorV2Interface(chainlinkVRFCoordinatorAddress_);
vrfProxyBlockchainID = vrfProxyBlockchainID_;
Expand Down Expand Up @@ -155,7 +157,6 @@ contract VRFProvider is VRFConsumerBaseV2, TeleporterOwnerUpgradeable, Reentranc
function _receiveTeleporterMessage(bytes32 sourceBlockchainID, address originSenderAddress, bytes memory message)
internal
override
nonReentrant
{
// Verify the sender.
require(sourceBlockchainID == vrfProxyBlockchainID, "VRFProvider: invalid source blockchain ID");
Expand Down
6 changes: 2 additions & 4 deletions contracts/src/VRFProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
TeleporterMessageInput, TeleporterFeeInfo
} from "@teleporter/contracts/src/Teleporter/ITeleporterMessenger.sol";
import {TeleporterOwnerUpgradeable} from "@teleporter/contracts/src/Teleporter/upgrades/TeleporterOwnerUpgradeable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {VRFConsumerBaseV2} from "@chainlink/contracts/src/v0.8/vrf/VRFConsumerBaseV2.sol";
import {GasUtils} from "./GasUtils.sol";

Expand All @@ -30,7 +29,7 @@ import {GasUtils} from "./GasUtils.sol";
* random values from a Chainlink VRF coordinator on that blockchain. All allowed consumers of the VRFProxy are
* capable of using VRF subscriptions available to the VRFProvider contract on the partner chain.
*/
contract VRFProxy is IVRFProxy, ReentrancyGuard, TeleporterOwnerUpgradeable {
contract VRFProxy is IVRFProxy, TeleporterOwnerUpgradeable {
using GasUtils for *;

/**
Expand Down Expand Up @@ -114,7 +113,7 @@ contract VRFProxy is IVRFProxy, ReentrancyGuard, TeleporterOwnerUpgradeable {
event RandomWordsFulfilled(uint256 indexed requestID, bool success);

constructor(address teleporterRegistryAddress_, bytes32 vrfProviderBlockchainID_, address vrfProviderAddress_)
TeleporterOwnerUpgradeable(teleporterRegistryAddress_)
TeleporterOwnerUpgradeable(teleporterRegistryAddress_, msg.sender)
{
require(vrfProviderAddress_ != address(0), "VRFProxy: zero VRF provider address");
vrfProviderBlockchainID = vrfProviderBlockchainID_;
Expand Down Expand Up @@ -219,7 +218,6 @@ contract VRFProxy is IVRFProxy, ReentrancyGuard, TeleporterOwnerUpgradeable {
function _receiveTeleporterMessage(bytes32 sourceBlockchainID, address originSenderAddress, bytes memory message)
internal
override
nonReentrant
{
// Verify the sender.
require(sourceBlockchainID == vrfProviderBlockchainID, "VRFProxy: invalid source blockchain ID");
Expand Down

0 comments on commit c008b4a

Please sign in to comment.