Skip to content

update deps #254

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

Open
wants to merge 5 commits into
base: master
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/glob-npm-8.0.3-750f909025-50bcdea19d.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/keyv-npm-4.5.0-57560bec53-d294873cf8.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
46 changes: 22 additions & 24 deletions contracts/GoldenSchema.sol
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,19 @@ contract GoldenSchema is OwnableUpgradeable {
return _predicates;
}

function addPredicate(bytes16 predicateID, bytes32 predicateCID)
public
onlyOwner
{
function addPredicate(
bytes16 predicateID,
bytes32 predicateCID
) public onlyOwner {
_predicateIDs.insert(predicateID);
predicateIDToLatestCID[predicateID] = predicateCID;
emit PredicateAdded(predicateID, predicateCID);
}

function updatePredicate(bytes16 predicateID, bytes32 predicateCID)
public
onlyOwner
{
function updatePredicate(
bytes16 predicateID,
bytes32 predicateCID
) public onlyOwner {
predicateIDToLatestCID[predicateID] = predicateCID;
emit PredicateUpdated(predicateID, predicateCID);
}
Expand All @@ -125,19 +125,19 @@ contract GoldenSchema is OwnableUpgradeable {
return _entityTypes;
}

function addEntityType(bytes16 entityTypeID, bytes32 entityTypeCID)
public
onlyOwner
{
function addEntityType(
bytes16 entityTypeID,
bytes32 entityTypeCID
) public onlyOwner {
_entityTypeIDs.insert(entityTypeID);
entityTypeIDToLatestCID[entityTypeID] = entityTypeCID;
emit EntityTypeAdded(entityTypeID, entityTypeCID);
}

function updateEntityType(bytes16 entityTypeID, bytes32 entityTypeCID)
public
onlyOwner
{
function updateEntityType(
bytes16 entityTypeID,
bytes32 entityTypeCID
) public onlyOwner {
entityTypeIDToLatestCID[entityTypeID] = entityTypeCID;
emit EntityTypeUpdated(entityTypeID, entityTypeCID);
}
Expand All @@ -150,21 +150,19 @@ contract GoldenSchema is OwnableUpgradeable {
);
}

function bulkAddEntityTypes(EntityType[] calldata types)
external
onlyOwner
{
function bulkAddEntityTypes(
EntityType[] calldata types
) external onlyOwner {
require(types.length > 0, 'bulk add 0 entity Types');
for (uint256 i = 0; i < types.length; i++) {
EntityType memory entityType = types[i];
addEntityType(entityType.entityTypeID, entityType.latestCID);
}
}

function bulkAddPredicates(Predicate[] calldata predcts)
external
onlyOwner
{
function bulkAddPredicates(
Predicate[] calldata predcts
) external onlyOwner {
require(predcts.length > 0, 'bulk add 0 predicates');
for (uint256 i = 0; i < predcts.length; i++) {
Predicate memory predicate = predcts[i];
Expand Down
9 changes: 7 additions & 2 deletions contracts/GoldenSchemaGovernor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ contract GoldenSchemaGovernor is
GovernorVotes,
GovernorVotesQuorumFraction
{
constructor(IVotes _tokenAddress, uint256 _quorumNumeratorValue)
constructor(
IVotes _tokenAddress,
uint256 _quorumNumeratorValue
)
Governor('GoldenSchemaGovernor')
GovernorSettings(0, 10 /* 2 mins */, 0)
GovernorVotes(_tokenAddress)
Expand All @@ -42,7 +45,9 @@ contract GoldenSchemaGovernor is
return super.votingPeriod();
}

function quorum(uint256 blockNumber)
function quorum(
uint256 blockNumber
)
public
view
override(IGovernor, GovernorVotesQuorumFraction)
Expand Down
18 changes: 8 additions & 10 deletions contracts/libraries/Bytes16Set.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@ library Bytes16Set {
* @param key value to check.
* @return bool true: Set member, false: not a Set member.
*/
function exists(Set storage self, bytes16 key)
internal
view
returns (bool)
{
function exists(
Set storage self,
bytes16 key
) internal view returns (bool) {
if (self.keyList.length == 0) return false;
return self.keyList[self.keyPointers[key]] == key;
}
Expand All @@ -74,11 +73,10 @@ library Bytes16Set {
* @param self storage pointer to a Set.
* @param index row to enumerate. Must be < count() - 1.
*/
function keyAtIndex(Set storage self, uint256 index)
internal
view
returns (bytes16)
{
function keyAtIndex(
Set storage self,
uint256 index
) internal view returns (bytes16) {
return self.keyList[index];
}

Expand Down
38 changes: 17 additions & 21 deletions contracts/nft/GoldenNFT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,17 @@ contract GoldenNFT is OwnableUpgradeable, AccessControlUpgradeable {
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
function __ERC721_init(string memory name_, string memory symbol_)
internal
onlyInitializing
{
function __ERC721_init(
string memory name_,
string memory symbol_
) internal onlyInitializing {
__ERC721_init_unchained(name_, symbol_);
}

function __ERC721_init_unchained(string memory name_, string memory symbol_)
internal
onlyInitializing
{
function __ERC721_init_unchained(
string memory name_,
string memory symbol_
) internal onlyInitializing {
name = name_;
symbol = symbol_;
}
Expand All @@ -124,11 +124,9 @@ contract GoldenNFT is OwnableUpgradeable, AccessControlUpgradeable {
return _entityToToken[entityId];
}

function getTokenIds(string[] calldata entityIds)
public
view
returns (uint256[] memory)
{
function getTokenIds(
string[] calldata entityIds
) public view returns (uint256[] memory) {
uint256[] memory tokenIds = new uint256[](entityIds.length);
for (uint256 i = 0; i < entityIds.length; i++) {
string memory entityId = entityIds[i];
Expand Down Expand Up @@ -223,10 +221,9 @@ contract GoldenNFT is OwnableUpgradeable, AccessControlUpgradeable {
* bulk mint users' NFT.
* returns the number of NFTs minted, ignores already minted ones.
*/
function bulkMint(string[] calldata entities)
external
onlyRole(MINTER_ROLE)
{
function bulkMint(
string[] calldata entities
) external onlyRole(MINTER_ROLE) {
require(entities.length > 0, 'bulkMint 0 NFTs');
for (uint256 i = 0; i < entities.length; i++) {
string memory entityId = entities[i];
Expand All @@ -237,10 +234,9 @@ contract GoldenNFT is OwnableUpgradeable, AccessControlUpgradeable {
/**
* bulk burn users' NFT.
*/
function bulkBurn(uint256[] calldata tokenIds)
external
onlyRole(BURNER_ROLE)
{
function bulkBurn(
uint256[] calldata tokenIds
) external onlyRole(BURNER_ROLE) {
require(tokenIds.length > 0, 'bulkBurn 0 NFTs');
for (uint256 i = 0; i < tokenIds.length; i++) {
uint256 tokenId = tokenIds[i];
Expand Down
8 changes: 4 additions & 4 deletions contracts/payouts/IPayoutsController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ interface IPayoutsController {
function getLastEpoch() external view returns (uint256);

// Returns true if the index has been marked claimed.
function isClaimed(uint256 epochId, uint256 index)
external
view
returns (bool);
function isClaimed(
uint256 epochId,
uint256 index
) external view returns (bool);

// Add a new Merkle Root and epoch.
function addMerkleRoot(bytes32 merkleRoot) external;
Expand Down
9 changes: 4 additions & 5 deletions contracts/payouts/PayoutsController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ contract PayoutsController is
emit MerkleRootAdded(newEpochId, merkleRoot);
}

function isClaimed(uint256 epochId, uint256 index)
public
view
returns (bool)
{
function isClaimed(
uint256 epochId,
uint256 index
) public view returns (bool) {
uint256 claimedWordIndex = index / 256;
uint256 claimedBitIndex = index % 256;
uint256 claimedWord = claimedBitMapByEpoch[epochId][claimedWordIndex];
Expand Down
9 changes: 4 additions & 5 deletions contracts/roles/OwnerRole.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,10 @@ contract OwnerRole {
/// @param role All authorizations for the contract
/// @param account The address that is guaranteed owner authorization
/// @return boolean
function _has(Role storage role, address account)
internal
view
returns (bool)
{
function _has(
Role storage role,
address account
) internal view returns (bool) {
require(account != address(0), 'Roles: account is the zero address');
return role.members[account];
}
Expand Down
8 changes: 4 additions & 4 deletions contracts/staking/EthStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ contract EthStaking is Initializable, OwnableUpgradeable, IEthStaking {
// How long should the staking be locked for, in blocks
uint256 public stakingPeriod;

function initialize(uint256 minimumStaking_, uint256 stakingPeriod_)
public
initializer
{
function initialize(
uint256 minimumStaking_,
uint256 stakingPeriod_
) public initializer {
__Ownable_init();
minimumStaking = minimumStaking_;
stakingPeriod = stakingPeriod_;
Expand Down
25 changes: 13 additions & 12 deletions contracts/token/GoldenToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,25 @@ contract GoldenToken is
_burn(msg.sender, amount);
}

function _afterTokenTransfer(address from, address to, uint256 amount)
internal
override(ERC20Upgradeable, ERC20VotesUpgradeable)
{
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal override(ERC20Upgradeable, ERC20VotesUpgradeable) {
super._afterTokenTransfer(from, to, amount);
}

function _mint(address to, uint256 amount)
internal
override(ERC20Upgradeable, ERC20VotesUpgradeable)
{
function _mint(
address to,
uint256 amount
) internal override(ERC20Upgradeable, ERC20VotesUpgradeable) {
super._mint(to, amount);
}

function _burn(address account, uint256 amount)
internal
override(ERC20Upgradeable, ERC20VotesUpgradeable)
{
function _burn(
address account,
uint256 amount
) internal override(ERC20Upgradeable, ERC20VotesUpgradeable) {
super._burn(account, amount);
}
}
33 changes: 2 additions & 31 deletions scripts/GnosisSdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,11 @@ const GNOSIS_WALLET2_PRIVATE_KEY = process.env.GNOSIS_WALLET2_PRIVATE_KEY;
let _GnosisSafeWallet1: Safe | undefined;
let _GnosisSafeWallet2: Safe | undefined;

// @ts-expect-error unused-variable
const _initAndExecGnosisTx = async (
ethers: HardhatEthers,
params: string[]
) => {
throw new Error('Deprecated, migrate to sepolia when Gnosis adds support');
const GoldenNFT = await ethers.getContract('GoldenNFT');
/**
* To burn some tokens do:
* const data = iface.encodeFunctionData("bulkBurn", [[1, 2, 3...]])
*/
const data = GoldenNFT.interface.encodeFunctionData('bulkMint', params);
try {
const receipt = await createGnosisTx(ethers, GoldenNFT.address, data);
if (receipt) {
const selectiveReceipt = {
...receipt,
logs: undefined,
events: undefined,
};
// Print receipt if you want to log logs and events as well
console.debug(
`>>> GNOSIS: safeTransaction executed ${JSON.stringify(
selectiveReceipt,
null,
4
)}`
);
} else {
console.error(`>>> GNOSIS receipt is undefined!!`);
}
} catch (e) {
console.error(`>>> GNOSIS error ${JSON.stringify(e, null, 2)}`);
}
};

const getSafes = async (ethers: HardhatEthers) => {
Expand Down Expand Up @@ -79,12 +50,12 @@ const getSafes = async (ethers: HardhatEthers) => {

const ethAdapter = new EthersAdapter({
ethers,
signer: firstSigner,
signerOrProvider: firstSigner,
});

const ethAdapter2 = new EthersAdapter({
ethers,
signer: secondSigner,
signerOrProvider: secondSigner,
});

// Safe Core SDK instance
Expand Down
2 changes: 1 addition & 1 deletion tasks/manageRoles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ task(`manage`, 'By default task will add role unless --remove flag is provided')
};

const action = params.remove ? 'remove' : 'add';
const role = params.role as keyof typeof executionMap['add' | 'remove'];
const role = params.role as keyof (typeof executionMap)['add' | 'remove'];

if (typeof executionMap[action][role] === 'undefined') {
throw new Error(
Expand Down
Loading