-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc409d9
commit eb90bcc
Showing
4 changed files
with
49 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
pragma solidity ^0.8.28; | ||
|
||
import {Script, console} from "forge-std/Script.sol"; | ||
import {RedeemHelper} from "src/helpers/RedeemHelper.sol"; | ||
|
||
contract DeployRedeemHelper is Script { | ||
address deployer = address(0x6BF173798733623cc6c221eD52c010472247d861); | ||
RedeemHelper public redeemHelper; // 0x8D46BA60Bf0c4A93d21dc1Db8F230Bdf1E7764A3 | ||
|
||
function setUp() public {} | ||
|
||
function run() public { | ||
vm.startBroadcast(deployer); | ||
|
||
redeemHelper = new RedeemHelper(); | ||
|
||
vm.stopBroadcast(); | ||
console.log(address(redeemHelper), "RedeemHelper"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
pragma solidity ^0.8.28; | ||
|
||
import {TypeDefinitions} from "circles-contracts-v2/hub/TypeDefinitions.sol"; | ||
import {BaseMintPolicyDefinitions} from "circles-contracts-v2/groups/Definitions.sol"; | ||
|
||
contract RedeemHelper { | ||
bytes32 public constant METADATATYPE_GROUPREDEEM = keccak256("CIRCLESv2:RESERVED_DATA:CirclesGroupRedeem"); | ||
|
||
/// @notice Converts the user's redemption values, including avatars and amounts, into a byte format suitable for use in a safeTransferFrom call. | ||
function convertRedemptionToBytes(uint256[] memory redemptionIds, uint256[] memory redemptionValues) | ||
external | ||
pure | ||
returns (bytes memory data) | ||
{ | ||
bytes memory userData = | ||
abi.encode(BaseMintPolicyDefinitions.BaseRedemptionPolicy(redemptionIds, redemptionValues)); | ||
|
||
data = abi.encode(TypeDefinitions.Metadata(METADATATYPE_GROUPREDEEM, "", userData)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters