Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full deployments for testnet #273

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Conversation

cinnabarhorse
Copy link
Member

No description provided.

@cinnabarhorse cinnabarhorse changed the title Gotchichain latest Geist Migration Oct 10, 2024
Aavegotchi memory _aavegotchi = s.aavegotchis[_tokenId];
bytes memory _metadata = abi.encode(_aavegotchi);
INFTBridge(s.gotchGeistBridge).bridge(_receiver, msg.sender, _tokenId, 1, _msgGasLimit, _connector, _metadata, new bytes(0));
if (_hasVault) { // this module should work when has vault
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the Vault? And what happens if there is no Vault? @orionstardust

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use if block.chainid == 137 { has vault}

if (_hasVault) { // this module should work when has vault
for (uint slot; slot < _aavegotchi.equippedWearables.length; slot++) {
uint wearableId = _aavegotchi.equippedWearables[slot];
if (wearableId != 0) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to check for borrowed wearables too

for (uint slot; slot < _aavegotchi.equippedWearables.length; slot++) {
if (_aavegotchi.equippedWearables[slot] != 0) {
uint wearableId = _aavegotchi.equippedWearables[slot];
if (isMint) { // if bridge is controller, mint
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we replace this with chainids?

if (_aavegotchi.equippedWearables[slot] != 0) {
uint wearableId = _aavegotchi.equippedWearables[slot];
if (isMint) { // if bridge is controller, mint
s.itemTypes[wearableId].totalQuantity += 1;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we decrease this when burning the token?

delete s.aavegotchis[_tokenId].equippedWearables[slot];
LibItems.removeFromParent(address(this), _tokenId, wearableId, 1);
LibItems.addToOwner(address(0), wearableId, 1);
s.itemTypes[wearableId].totalQuantity -= 1;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay i see we are lowering the quantity, good

// delete aavegotchi info
string memory name = _aavegotchi.name;
if (bytes(name).length > 0) {
delete s.aavegotchiNamesUsed[LibAavegotchi.validateAndLowerName(name)];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can people rename gotchis on Geist side?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. disable renaming on polygon
  2. migrate all names on Geist
  3. enable renaming on Geist
  4. ensure names are handled in the metadata transfer

@@ -159,7 +159,7 @@ library LibAavegotchi {
aavegotchiInfo_.equippedWearables = s.aavegotchis[_tokenId].equippedWearables;
aavegotchiInfo_.collateral = s.aavegotchis[_tokenId].collateralType;
aavegotchiInfo_.escrow = s.aavegotchis[_tokenId].escrow;
aavegotchiInfo_.stakedAmount = IERC20(aavegotchiInfo_.collateral).balanceOf(aavegotchiInfo_.escrow);
// aavegotchiInfo_.stakedAmount = IERC20(aavegotchiInfo_.collateral).balanceOf(aavegotchiInfo_.escrow);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we will tell users to pull out their collateral
two choices:

  1. pull out all collateral
  2. allow users to stake erc20 GHST instead

so when a gotchi bridges, we should require(stakedAmount < 0.001)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe could just unstake it for them during bridging

@orionstardust orionstardust marked this pull request as ready for review October 25, 2024 05:15
address _ownershipFacet
address _ownershipFacet,
address _aavegotchiDiamond,
address wearableDiamond
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this change on Polygon because this code isn't being redeployed.

@@ -46,24 +46,24 @@ contract ForgeFacet is Modifiers {
}

// External contracts
function aavegotchiGameFacet() internal pure returns (AavegotchiGameFacet facet) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this change on Polygon because this code isn't being redeployed.

@@ -116,7 +114,7 @@ contract ForgeVRFFacet is Modifiers {
s.vrfUserToRequestIds[sender].push(requestId);

// for testing
// tempFulfillRandomness(requestId, uint256(keccak256(abi.encodePacked(block.number, _geodeTokenIds[0]))));
// tempFulfillRandomness(requestId, uint256(keccak256(abi.encodePacked(block.number, _geodeTokenIds[0]))));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this change on Polygon because this code isn't being redeployed.

}

bytes32 public constant DIAMOND_STORAGE_POSITION = keccak256("diamond.standard.diamond.storage");
address public constant AAVEGOTCHI_DIAMOND = 0x86935F11C86623deC8a25696E1C19a8659CbF95d;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this change on Polygon because this code isn't being redeployed.

address vrfCoordinator;
address linkAddress;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this change on Polygon because this code isn't being redeployed.

address public constant AAVEGOTCHI_DIAMOND = 0x86935F11C86623deC8a25696E1C19a8659CbF95d;
address public constant WEARABLE_DIAMOND = 0x58de9AaBCaeEC0f69883C94318810ad79Cc6a44f;
// address public constant AAVEGOTCHI_DIAMOND = 0x86935F11C86623deC8a25696E1C19a8659CbF95d;
// address public constant WEARABLE_DIAMOND = 0x58de9AaBCaeEC0f69883C94318810ad79Cc6a44f;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this change on Polygon because this code isn't being redeployed.

@orionstardust orionstardust changed the title Geist Migration Full deployments for testnet Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants