Skip to content

Commit

Permalink
remove unused identifier field from TraitRedemption
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanio committed Nov 2, 2023
1 parent 756761a commit 6860365
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 9 deletions.
1 change: 0 additions & 1 deletion script/DeployAndRedeemTrait.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ contract DeployAndRedeemTrait is Script, Test {
traitRedemptions[0] = TraitRedemption({
substandard: 1,
token: address(redeemToken),
identifier: 0, // unused field
traitKey: traitKey,
traitValue: traitValue,
substandardValue: substandardValue
Expand Down
4 changes: 1 addition & 3 deletions src/lib/ERC7498NFTRedeemables.sol
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,7 @@ contract ERC7498NFTRedeemables is IERC165, IERC7498, DynamicTraits, RedeemablesE
uint256 newTraitValue = uint256(currentTraitValue) - uint256(traitValue);

// Decrement the trait by the trait value.
IERC7496(token).setTrait(
traitRedemptions[i].identifier, traitRedemptions[i].traitKey, bytes32(newTraitValue)
);
IERC7496(token).setTrait(identifier, traitRedemptions[i].traitKey, bytes32(newTraitValue));
} else if (substandard == 4) {
// Revert if the current trait value is not equal to the substandard value.
if (currentTraitValue != substandardValue) {
Expand Down
1 change: 0 additions & 1 deletion src/lib/RedeemablesStructs.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ struct CampaignRequirements {
struct TraitRedemption {
uint8 substandard;
address token;
uint256 identifier;
bytes32 traitKey;
bytes32 traitValue;
bytes32 substandardValue;
Expand Down
1 change: 0 additions & 1 deletion test/ERC7498-DynamicTraits.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ contract ERC7498_DynamicTraits is BaseRedeemablesTest {
traitRedemptions[0] = TraitRedemption({
substandard: 1,
token: address(redeemToken),
identifier: 0, // unused field
traitKey: traitKey,
traitValue: bytes32(uint256(1)),
substandardValue: bytes32(uint256(0))
Expand Down
1 change: 0 additions & 1 deletion test/RedeemableContractOfferer-1155.t.sol.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,6 @@ contract TestRedeemableContractOfferer_1155 is BaseOrderTest, RedeemablesErrors
// TraitRedemption memory traitRedemption = TraitRedemption({
// substandard: 0, // set value to traitValue
// token: address(dynamicTraitsToken),
// identifier: redeemableTokenId0,
// traitKey: "isRedeemed",
// traitValue: bytes32(abi.encode(1)),
// substandardValue: bytes32(abi.encode(0))
Expand Down
2 changes: 0 additions & 2 deletions test/RedeemableContractOfferer-721.t.sol.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@ contract TestRedeemableContractOfferer_721 is BaseOrderTest, RedeemablesErrors {
// traitRedemption: TraitRedemption({
// substandard: 0, // set value to traitValue
// token: address(dynamicTraitsToken),
// identifier: redeemableTokenId0,
// traitKey: "isRedeemed",
// traitValue: bytes32(abi.encode(1)),
// substandardValue: bytes32(abi.encode(0))
Expand All @@ -1036,7 +1035,6 @@ contract TestRedeemableContractOfferer_721 is BaseOrderTest, RedeemablesErrors {
TraitRedemption memory traitRedemption = TraitRedemption({
substandard: 0, // set value to traitValue
token: address(dynamicTraitsToken),
identifier: redeemableTokenId0,
traitKey: "isRedeemed",
traitValue: bytes32(abi.encode(1)),
substandardValue: bytes32(abi.encode(0))
Expand Down

0 comments on commit 6860365

Please sign in to comment.