Skip to content

Commit

Permalink
include XP event
Browse files Browse the repository at this point in the history
  • Loading branch information
Timidan committed May 21, 2023
1 parent 6f828d0 commit bb739ad
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 58 deletions.
9 changes: 2 additions & 7 deletions contracts/Aavegotchi/facets/VRFFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ import {ILink} from "../interfaces/ILink.sol";
* @dev until it calls fulfillRandomness().
*/

contract VrfFacet is Modifiers {
contract VRFFacet is Modifiers {
event VrfRandomNumber(uint256 indexed tokenId, uint256 randomNumber, uint256 _vrfTimeSet);
event OpenPortals(uint256[] _tokenIds);
event PortalOpened(uint256 indexed tokenId);
Expand Down Expand Up @@ -194,12 +194,7 @@ contract VrfFacet is Modifiers {
//@param _keyHash New keyhash
//@param _vrfCoordinator The new vrf coordinator address
//@param _link New LINK token contract address
function changeVrf(
uint256 _newFee,
bytes32 _keyHash,
address _vrfCoordinator,
address _link
) external onlyOwner {
function changeVrf(uint256 _newFee, bytes32 _keyHash, address _vrfCoordinator, address _link) external onlyOwner {
if (_newFee != 0) {
s.fee = uint96(_newFee);
}
Expand Down
7 changes: 7 additions & 0 deletions contracts/Aavegotchi/libraries/LibAavegotchi.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {IERC721} from "../../shared/interfaces/IERC721.sol";
import {LibERC721} from "../../shared/libraries/LibERC721.sol";
import {LibItems, ItemTypeIO} from "../libraries/LibItems.sol";

import {LibXPAllocation} from "./LibXPAllocation.sol";

struct AavegotchiCollateralTypeIO {
address collateralType;
AavegotchiCollateralTypeInfo collateralTypeInfo;
Expand Down Expand Up @@ -372,6 +374,11 @@ library LibAavegotchi {
revert("Kinship too low to reduce");
} else {
s.aavegotchis[_tokenId].interactionCount -= _amount;
uint256[] memory tokenIds = new uint256[](1);
uint256[] memory xpAmounts = new uint256[](1);
tokenIds[0] = _tokenId;
xpAmounts[0] = s.aavegotchis[_tokenId].interactionCount;
emit LibXPAllocation.GrantExperience(tokenIds, xpAmounts);
}
}
}
54 changes: 27 additions & 27 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ dotenv.config({ path: __dirname + "/.env" });

// require("./tasks/verifyFacet.js");
require("./tasks/deployUpgrade.ts");
require("./tasks/addBaadgeSvgs.ts");
require("./tasks/mintBaadgeSvgs.ts");
require("./tasks/baadgeAirdrop.ts");
require("./tasks/updateItemDimensions.ts");
require("./tasks/updateSvgs.ts");
require("./tasks/updateItemSideDimensions.ts");
require("./tasks/batchDeposit.ts");
require("./tasks/rarityPayouts");
require("./tasks/grantXP_snapshot");
require("./tasks/grantXP_minigame");
require("./tasks/grantXP");
// require("./tasks/addBaadgeSvgs.ts");
// require("./tasks/mintBaadgeSvgs.ts");
// require("./tasks/baadgeAirdrop.ts");
// require("./tasks/updateItemDimensions.ts");
// require("./tasks/updateSvgs.ts");
// require("./tasks/updateItemSideDimensions.ts");
// require("./tasks/batchDeposit.ts");
// require("./tasks/rarityPayouts");
// require("./tasks/grantXP_snapshot");
// require("./tasks/grantXP_minigame");
// require("./tasks/grantXP");
require("./tasks/addItemTypes");
require("./tasks/addWearableSets");
require("./tasks/grantXP_customValues");
Expand Down Expand Up @@ -60,27 +60,27 @@ export default {
matic: {
url: process.env.MATIC_URL,
// url: 'https://rpc-mainnet.maticvigil.com/',
accounts: [process.env.ITEM_MANAGER],
accounts: [process.env.SECRET],
// blockGasLimit: 20000000,
blockGasLimit: 20000000,
gasPrice: 400000000000,
timeout: 90000,
},
tenderly: {
url: process.env.TENDERLY_FORK,
chainId: Number(process.env.TENDERLY_NETWORK_ID),
accounts: [process.env.ITEM_MANAGER],
// blockGasLimit: 20000000,
blockGasLimit: 20000000,
gasPrice: 1000000000,
timeout: 90000,
},
mumbai: {
url: process.env.MUMBAI_URL,
accounts: [process.env.SECRET],
blockGasLimit: 20000000,
gasPrice: 1000000000,
},
// tenderly: {
// url: process.env.TENDERLY_FORK,
// chainId: Number(process.env.TENDERLY_NETWORK_ID),
// accounts: [process.env.ITEM_MANAGER],
// // blockGasLimit: 20000000,
// blockGasLimit: 20000000,
// gasPrice: 1000000000,
// timeout: 90000,
// },
// mumbai: {
// url: process.env.MUMBAI_URL,
// accounts: [process.env.SECRET],
// blockGasLimit: 20000000,
// gasPrice: 1000000000,
// },
// gorli: {
// url: process.env.GORLI,
// accounts: [process.env.SECRET],
Expand Down
36 changes: 18 additions & 18 deletions svgs/wearables-sides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,14 @@ export const wearablesRightSvgs = [
wearable("359_ForgeGogglesRight"),
wearable("360_GeodeSmasherRight"),
wearable("361_GeoRight"),
bodyWearableRight("362_FAKEShirt"),
wearable("363_FAKEBeretRight"),
bodyWearableRight("362_FakeShirt"),
wearable("363_FakeBeretRight"),
wearable("364_PaintBrushRight"),
wearable("365_PaintPaletteRight"),
bodyWearableRight("366_HeavenlyRobes"),
wearable("367_EyesofDevotionRight"),
wearable("368_BeardofDivinityRight"),
wearable("369_StaffofCreationRight"),
wearable("367_EyesOfDevotionRight"),
wearable("368_BeardOfDivinityRight"),
wearable("369_StaffOfCreationRight"),
];

export const wearablesBackSvgs = [
Expand Down Expand Up @@ -744,14 +744,14 @@ export const wearablesBackSvgs = [
wearable("359_ForgeGogglesBack"),
wearable("360_GeodeSmasherBack"),
wearable("361_GeoBack"),
bodyWearable("362_FAKEShirt"),
wearable("363_FAKEBeretBack"),
bodyWearable("362_FakeShirt"),
wearable("363_FakeBeretBack"),
wearable("364_PaintBrushBack"),
wearable("365_PaintPaletteBack"),
bodyWearable("366_HeavenlyRobes"),
"367_EyesofDevotionBack",
"368_BeardofDivinityBack",
wearable("369_StaffofCreationBack"),
"367_EyesOfDevotionBack",
"368_BeardOfDivinityBack",
wearable("369_StaffOfCreationBack"),
];

export const wearablesLeftSvgs = [
Expand Down Expand Up @@ -1121,14 +1121,14 @@ export const wearablesLeftSvgs = [
wearable("359_ForgeGogglesLeft"),
wearable("360_GeodeSmasherLeft"),
wearable("361_GeoLeft"),
bodyWearableLeft("362_FAKEShirt"),
wearable("363_FAKEBeretLeft"),
bodyWearableLeft("362_FakeShirt"),
wearable("363_FakeBeretLeft"),
wearable("364_PaintBrushLeft"),
wearable("365_PaintPaletteLeft"),
bodyWearableLeft("366_HeavenlyRobes"),
wearable("367_EyesofDevotionLeft"),
wearable("368_BeardofDivinityLeft"),
wearable("369_StaffofCreationLeft"),
wearable("367_EyesOfDevotionLeft"),
wearable("368_BeardOfDivinityLeft"),
wearable("369_StaffOfCreationLeft"),
];

export const wearablesLeftSleeveSvgs = [
Expand Down Expand Up @@ -1331,7 +1331,7 @@ export const wearablesLeftSleeveSvgs = [
sleeveWearableLeft("318_TrackSuit"),
// forge wearables
sleeveWearableLeft("350_PixelcraftTee"),
sleeveWearableLeft("362_FAKEShirt"),
sleeveWearableLeft("362_FakeShirt"),
sleeveWearableLeft("366_HeavenlyRobes"),
];

Expand Down Expand Up @@ -1535,7 +1535,7 @@ export const wearablesRightSleeveSvgs = [
sleeveWearableRight("318_TrackSuit"),
// forge wearables
sleeveWearableRight("350_PixelcraftTee"),
sleeveWearableRight("362_FAKEShirt"),
sleeveWearableRight("362_FakeShirt"),
sleeveWearableRight("366_HeavenlyRobes"),
];

Expand Down Expand Up @@ -1737,7 +1737,7 @@ export const wearablesBackSleeveSvgs = [
sleeveWearableRight("318_TrackSuit"),
// forge wearables
sleeveWearableRight("350_PixelcraftTee"),
sleeveWearableRight("362_FAKEShirt"),
sleeveWearableRight("362_FakeShirt"),
sleeveWearableRight("366_HeavenlyRobes"),
];

Expand Down
12 changes: 6 additions & 6 deletions svgs/wearables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,14 @@ export const wearablesSvgs = [
wearable("359_ForgeGoggles"),
wearable("360_GeodeSmasher"),
wearable("361_Geo"),
bodyWearable("362_FAKEShirt"),
wearable("363_FAKEBeret"),
bodyWearable("362_FakeShirt"),
wearable("363_FakeBeret"),
wearable("364_PaintBrush"),
wearable("365_PaintPalette"),
bodyWearable("366_HeavenlyRobes"),
wearable("367_EyesofDevotion"),
wearable("368_BeardofDivinity"),
wearable("369_StaffofCreation"),
wearable("367_EyesOfDevotion"),
wearable("368_BeardOfDivinity"),
wearable("369_StaffOfCreation"),
];

export const sleeveSvgs = [
Expand Down Expand Up @@ -577,7 +577,7 @@ export const sleeveSvgs = [
sleeves("318_TrackSuit"),
// forge wearables
sleeves("350_PixelcraftTee"),
sleeves("362_FAKEShirt"),
sleeves("362_FakeShirt"),
sleeves("366_HeavenlyRobes"),
];

Expand Down

0 comments on commit bb739ad

Please sign in to comment.