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

Skip tokensmanager #1771 #1795

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion contracts/CharactersBridgeProxyContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import "./CharacterRenameTagConsumables.sol";
import "./characters.sol";
import "./interfaces/IBridgeProxy.sol";
import "./Promos.sol";
import "./EquipmentManager.sol";


contract CharactersBridgeProxyContract is Initializable, AccessControlUpgradeable, IBridgeProxy {
Expand All @@ -24,6 +25,7 @@ contract CharactersBridgeProxyContract is Initializable, AccessControlUpgradeabl
uint8 public constant UINT_NFT_VAR_SEED3DCOSMETIC = 1;

Promos promos;
EquipmentManager equipmentManager;


modifier restricted() {
Expand Down Expand Up @@ -51,6 +53,11 @@ contract CharactersBridgeProxyContract is Initializable, AccessControlUpgradeabl
promos = _newPromos;
}

function migrate_68c6936(EquipmentManager _equipmentManager) external {
require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender));
equipmentManager = _equipmentManager;
}


function collectData(uint256 tokenId) external view override returns (uint256[] memory uintVars, string memory stringVar) {
string memory rename = characterRenameTagConsumables.getCharacterRename(tokenId);
Expand Down Expand Up @@ -124,6 +131,7 @@ contract CharactersBridgeProxyContract is Initializable, AccessControlUpgradeabl
}

function canBridge(address wallet, uint256 tokenId, uint256 targetChain) external view override returns (bool) {
return characters.getNftVar(tokenId, 3) == 0; // Only gen 1 is allowed
return characters.getNftVar(tokenId, 3) == 0 // Only gen 1 is allowed
&& equipmentManager.getNftVar(address(characters), tokenId, 1) == 0; // Nothing equipped
}
}
Loading