Skip to content

Commit

Permalink
Merge pull request #144 from bosonprotocol/ID_to_Id
Browse files Browse the repository at this point in the history
  • Loading branch information
mischat authored Sep 27, 2021
2 parents 07c065a + 8744960 commit 13cacd5
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion contracts/BosonRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ contract BosonRouter is
uint256 _tokensSent
) internal returns (uint256) {
uint256 tokenIdSupply = IVoucherKernel(voucherKernel)
.createTokenSupplyID(
.createTokenSupplyId(
msg.sender,
metadata[0],
metadata[1],
Expand Down
10 changes: 5 additions & 5 deletions contracts/Gate.sol
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,20 @@ contract Gate is IGate, Ownable, Pausable {
/**
* @notice Registers connection between setID and tokenID
* @param _tokenIdSupply an ID of a supply token (ERC-1155) [voucherSetID]
* @param _nftTokenID an ID of a quest token
* @param _nftTokenId an ID of a quest token
*/
function registerVoucherSetId(uint256 _tokenIdSupply, uint256 _nftTokenID)
function registerVoucherSetId(uint256 _tokenIdSupply, uint256 _nftTokenId)
external
override
whenNotPaused
onlyOwner
{
require(_nftTokenID != 0, "TOKEN_ID_0_NOT_ALLOWED");
require(_nftTokenId != 0, "TOKEN_ID_0_NOT_ALLOWED");
require(_tokenIdSupply != 0, "INVALID_TOKEN_SUPPLY");

voucherToToken[_tokenIdSupply] = _nftTokenID;
voucherToToken[_tokenIdSupply] = _nftTokenId;

emit LogVoucherSetRegistered(_tokenIdSupply, _nftTokenID);
emit LogVoucherSetRegistered(_tokenIdSupply, _nftTokenId);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/VoucherKernel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ contract VoucherKernel is IVoucherKernel, Ownable, Pausable, UsingHelpers {
* @param _depositSe Seller's deposit
* @param _depositBu Buyer's deposit
*/
function createTokenSupplyID(
function createTokenSupplyId(
address _seller,
uint256 _validFrom,
uint256 _validTo,
Expand Down
9 changes: 4 additions & 5 deletions contracts/interfaces/IGate.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface IGate {
);
event LogVoucherSetRegistered(
uint256 indexed _tokenIdSupply,
uint256 indexed _nftTokenID
uint256 indexed _nftTokenId
);
event LogUserVoucherDeactivated(
address indexed _user,
Expand Down Expand Up @@ -47,18 +47,17 @@ interface IGate {
/**
* @notice Registers connection between setID and tokenID
* @param _tokenIdSupply an ID of a supply token (ERC-1155)
* @param _nftTokenID an ID of a quest token
* @param _nftTokenId an ID of a quest token
*/
function registerVoucherSetId(uint256 _tokenIdSupply, uint256 _nftTokenId)
external;

/**
* @notice Gets the contract address, where gate contract checks if quest NFT token exists
* @return Address of contract that hold non transferable NFTs (quest NFTs)
*/
function getNonTransferableTokenContract() external view returns (address);

function registerVoucherSetId(uint256 _tokenIdSupply, uint256 _nftTokenID)
external;

/**
* @notice Checks if user possesses the required quest NFT token for given voucher set
* @param _user user address
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IVoucherKernel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface IVoucherKernel {
* @param _depositSe Seller's deposit
* @param _depositBu Buyer's deposit
*/
function createTokenSupplyID(
function createTokenSupplyId(
address _seller,
uint256 _validFrom,
uint256 _validTo,
Expand Down
8 changes: 4 additions & 4 deletions contracts/mocks/MockBosonRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ contract MockBosonRouter is
//hex"54" FISSION.code(FISSION.Category.Finance, FISSION.Status.InsufficientFunds)

uint256 tokenIdSupply =
IVoucherKernel(voucherKernel).createTokenSupplyID(
IVoucherKernel(voucherKernel).createTokenSupplyId(
msg.sender,
metadata[0],
metadata[1],
Expand Down Expand Up @@ -208,7 +208,7 @@ contract MockBosonRouter is
);

uint256 tokenIdSupply =
IVoucherKernel(voucherKernel).createTokenSupplyID(
IVoucherKernel(voucherKernel).createTokenSupplyId(
msg.sender,
metadata[0],
metadata[1],
Expand Down Expand Up @@ -332,7 +332,7 @@ contract MockBosonRouter is
);

uint256 tokenIdSupply =
IVoucherKernel(voucherKernel).createTokenSupplyID(
IVoucherKernel(voucherKernel).createTokenSupplyId(
msg.sender,
metadata[0],
metadata[1],
Expand Down Expand Up @@ -378,7 +378,7 @@ contract MockBosonRouter is
//hex"54" FISSION.code(FISSION.Category.Finance, FISSION.Status.InsufficientFunds)

uint256 tokenIdSupply =
IVoucherKernel(voucherKernel).createTokenSupplyID(
IVoucherKernel(voucherKernel).createTokenSupplyId(
msg.sender,
metadata[0],
metadata[1],
Expand Down
10 changes: 5 additions & 5 deletions contracts/mocks/MockGate.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,20 @@ contract MockGate is IGate, Ownable, Pausable {
/**
* @notice Registers connection between setID and tokenID
* @param _tokenIdSupply an ID of a supply token (ERC-1155) [voucherSetID]
* @param _nftTokenID an ID of a quest token
* @param _nftTokenId an ID of a quest token
*/
function registerVoucherSetId(uint256 _tokenIdSupply, uint256 _nftTokenID)
function registerVoucherSetId(uint256 _tokenIdSupply, uint256 _nftTokenId)
external
override
whenNotPaused
onlyFromRouter
{
require(_nftTokenID != 0, "TOKEN_ID_0_NOT_ALLOWED");
require(_nftTokenId != 0, "TOKEN_ID_0_NOT_ALLOWED");
require(_tokenIdSupply != 0, "INVALID_TOKEN_SUPPLY");

voucherToToken[_tokenIdSupply] = _nftTokenID;
voucherToToken[_tokenIdSupply] = _nftTokenId;

emit LogVoucherSetRegistered(_tokenIdSupply, _nftTokenID);
emit LogVoucherSetRegistered(_tokenIdSupply, _nftTokenId);
}

/**
Expand Down

0 comments on commit 13cacd5

Please sign in to comment.