Skip to content

Commit

Permalink
bump dependencies and add karma
Browse files Browse the repository at this point in the history
  • Loading branch information
backmeupplz committed May 15, 2023
1 parent 199dd54 commit aa0adab
Show file tree
Hide file tree
Showing 9 changed files with 7,570 additions and 12,015 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"solidity.compileUsingRemoteVersion": "v0.8.17"
"solidity.compileUsingRemoteVersion": "v0.8.20"
}
807 changes: 0 additions & 807 deletions .yarn/releases/yarn-3.3.0.cjs

This file was deleted.

873 changes: 873 additions & 0 deletions .yarn/releases/yarn-3.5.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ plugins:
- path: .yarn/plugins/yarn-up-all-plugin.cjs
spec: "https://github.com/e5mode/yarn-up-all/releases/download/1.1.0/index.js"

yarnPath: .yarn/releases/yarn-3.3.0.cjs
yarnPath: .yarn/releases/yarn-3.5.1.cjs
25 changes: 25 additions & 0 deletions contracts/KetlKarma.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract KetlKarma is ERC20, Ownable {
constructor(address owner) ERC20("KetlKarma", "KK") {
transferOwnership(owner);
}

function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}

function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual override {
super._beforeTokenTransfer(from, to, amount);

require(from == address(0), "KetlKarma: transfer not allowed");
}
}
10 changes: 9 additions & 1 deletion contracts/OBSSStorage.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/utils/Counters.sol";
import "@opengsn/contracts/src/ERC2771Recipient.sol";
import "@big-whale-labs/ketl-allow-map-contract/contracts/KetlAllowMap.sol";
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "./KetlKarma.sol";

/**
* @title OBSSStorage
Expand Down Expand Up @@ -42,6 +43,8 @@ contract OBSSStorage is
mapping(uint256 => Counters.Counter) public lastReactionIds;
mapping(uint256 => mapping(address => uint256)) public reactionsUserToId;
bool public isDataMigrationLocked;
// Karma
KetlKarma public karma;

// IPFS cid represented in a more efficient way
struct CID {
Expand Down Expand Up @@ -146,6 +149,8 @@ contract OBSSStorage is
// Set owner
__Ownable_init();
isDataMigrationLocked = false;
// Set karma
karma = new KetlKarma(address(this));
}

function addAddressToVCAllowMap(
Expand Down Expand Up @@ -310,6 +315,9 @@ contract OBSSStorage is
if (msg.value > 0) {
payable(post.author).transfer(msg.value);
}
if (reactionRequest.reactionType == 1) {
karma.mint(post.author, 1);
}
emit ReactionAdded(
_msgSender(),
reactionRequest.postId,
Expand Down
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const {

const config: HardhatUserConfig = {
solidity: {
version: '0.8.17',
version: '0.8.20',
settings: {
optimizer: {
enabled: true,
Expand Down
60 changes: 30 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,57 +33,57 @@
"prepublishOnly": "yarn build && yarn tsc"
},
"devDependencies": {
"@big-whale-labs/constants": "^0.1.58",
"@big-whale-labs/constants": "^0.1.85",
"@big-whale-labs/versioned-contract": "^1.0.2",
"@ethersproject/providers": "^5.7.2",
"@nomiclabs/hardhat-ethers": "^2.2.1",
"@nomiclabs/hardhat-etherscan": "^3.1.3",
"@nomiclabs/hardhat-waffle": "^2.0.3",
"@opengsn/contracts": "^3.0.0-beta.1",
"@openzeppelin/contracts": "^4.8.0",
"@typechain/ethers-v5": "^10.1.1",
"@typechain/hardhat": "^6.1.4",
"@types/chai": "^4.3.4",
"@nomiclabs/hardhat-ethers": "^2.2.3",
"@nomiclabs/hardhat-etherscan": "^3.1.7",
"@nomiclabs/hardhat-waffle": "^2.0.5",
"@opengsn/contracts": "^3.0.0-beta.6",
"@openzeppelin/contracts": "^4.8.3",
"@typechain/ethers-v5": "^10.2.1",
"@typechain/hardhat": "^6.1.6",
"@types/chai": "^4.3.5",
"@types/mocha": "^10.0.1",
"@types/node": "^18.11.12",
"@types/prompt": "^1.1.4",
"@typescript-eslint/eslint-plugin": "^5.46.0",
"@typescript-eslint/parser": "^5.46.0",
"@types/node": "^20.1.4",
"@types/prompt": "^1.1.5",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"chai": "^4.3.7",
"dotenv": "^16.0.3",
"envalid": "^7.3.1",
"eslint": "^8.29.0",
"eslint-config-prettier": "^8.5.0",
"eslint": "^8.40.0",
"eslint-config-prettier": "^8.8.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.6.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-sort-imports-es6-autofix": "^0.6.0",
"ethereum-waffle": "^3.4.4",
"ethereum-waffle": "^4.0.10",
"ethers": "^5.7.2",
"hardhat": "^2.12.4",
"hardhat": "^2.14.0",
"hardhat-gas-reporter": "^1.0.9",
"np": "^7.6.2",
"prettier": "^2.8.1",
"prettier-plugin-solidity": "^1.0.0",
"np": "^7.7.0",
"prettier": "^2.8.8",
"prettier-plugin-solidity": "^1.1.3",
"prompt": "^1.3.0",
"solhint": "^3.3.7",
"solhint": "^3.4.1",
"solidity-coverage": "^0.8.2",
"ts-node": "^10.9.1",
"typechain": "^8.1.1",
"typescript": "^4.9.4"
"typescript": "^5.0.4"
},
"packageManager": "yarn@3.3.0",
"packageManager": "yarn@3.5.1",
"dependencies": {
"@big-whale-labs/constants": "^0.1.39",
"@big-whale-labs/constants": "^0.1.85",
"@big-whale-labs/ketl-allow-map-contract": "^0.0.3",
"@big-whale-labs/obss-storage-contract": "^0.1.4",
"@openzeppelin/contracts-upgradeable": "^4.8.2",
"@openzeppelin/hardhat-upgrades": "^1.22.1",
"@zk-kit/incremental-merkle-tree": "^1.0.0",
"@zk-kit/incremental-merkle-tree.sol": "^1.3.3",
"@openzeppelin/contracts-upgradeable": "^4.8.3",
"@openzeppelin/hardhat-upgrades": "^1.26.0",
"@zk-kit/incremental-merkle-tree": "^1.1.0",
"@zk-kit/incremental-merkle-tree.sol": "^1.7.0",
"circomlibjs": "^0.1.7"
}
}
Loading

0 comments on commit aa0adab

Please sign in to comment.