The address of a whitelist instance already deployed using Talaria App.
Basic understanding of smart contracts
1. Create your Beta Testing Logic
BetaProtocol.sol
// SPDX-License-Identifier: MITpragmasolidity ^0.8.20;import {Ownable} from"@openzeppelin/contracts/access/Ownable.sol";interface IWhitelist {functionusersWhitelisted(address user) externalviewreturns (bool);}abstractcontractBetaProtocolisOwnable {/* * @dev The whitelist contract instance */ IWhitelist public whitelist;/* * @dev Whether beta access is enabled */boolpublic betaAccessEnabled;errorUserNotWhitelistedAndBetaAccessIsEnabled();/* * @dev Modifier to check if the user is whitelisted */modifieronlyWhitelisted() {if (betaAccessEnabled &&!whitelist.usersWhitelisted(msg.sender)) {revertUserNotWhitelistedAndBetaAccessIsEnabled(); } _; }/* * @dev Constructor to set the whitelist contract address and initialize access */constructor(address_whitelist) Ownable(msg.sender) { whitelist =IWhitelist(_whitelist); // Assign the whitelist contract betaAccessEnabled =true; // Start with beta access enabled }/* * @dev Set the beta access enabled flag */functionsetBetaAccessEnabled(bool_enabled) publiconlyOwner { betaAccessEnabled = _enabled; }}
2. Use it
YourProtocol.sol
// SPDX-License-Identifier: MITpragmasolidity ^0.8.20;import {BetaProtocol} from"./BetaProtocol.sol";/** @dev This is an example protocol that uses the Talaria beta access whitelist*/contractYourProtocolisBetaProtocol {/* * @dev Constructor * @param _whitelist The address of the whitelist contract instance, you can generate one at app.talariaprotocol.xyz */constructor(address_whitelist) BetaProtocol(_whitelist) {}/* * @dev Test function * @notice This function is only callable by whitelisted users */functiontest() publicviewonlyWhitelisted {// Your logic }}
You can add the address of the whitelist either via argument at deployment or hard-coded.