This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.23; | |
import { Script } from "forge-std/Script.sol"; | |
import { console2 } from "forge-std/console2.sol"; | |
/// @title ERC7201 Helper Script | |
/// @author Raul Martinez (Story Protocol) | |
/// @notice This script logs the boilerplate code for ERC7201 storage location and getter function, to | |
/// help developers implement the ERC7201 interface in their contracts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"abi": [ | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "owner", | |
"type": "address" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"abi": [ | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "owner", | |
"type": "address" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async preparePermitDataStruct (holder, allowed) { | |
const netId = await this.web3.eth.net.getId() | |
let nonce = await this.stableTokenContract.methods.nonces(holder).call({ | |
from: holder | |
}) | |
const expiration = Math.floor(Date.now() / 1000) + 900000 | |
const EIP712Domain = [ | |
{ | |
name: 'name', | |
type: 'string' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"contractName": "MockStableCoin", | |
"abi": [ | |
{ | |
"inputs": [ | |
{ | |
"internalType": "uint256", | |
"name": "chainId_", | |
"type": "uint256" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios' | |
import VueAxios from 'vue-axios' | |
import Vue from 'vue' | |
Vue.use(VueAxios, axios) | |
Vue.axios.defaults.baseURL = process.env.VUE_APP_BASE_URL | |
Vue.axios.defaults.headers.common['Content-Type'] = 'application/json' | |
Vue.axios.defaults.headers.post['Content-Type'] = 'application/json' | |
Vue.axios.defaults.headers.put['Content-Type'] = 'application/json' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Restart one service | |
docker-compose -f local.yml build --no-cache $(docker ps --format '{{.Names}}' --filter=ancestor=ethichub_local_vue) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.23; | |
/** | |
* @title SafeMath | |
* @dev Math operations with safety checks that throw on error | |
*/ | |
library SafeMath { | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.23; | |
import '../EthicHubBase.sol'; | |
import '../math/SafeMath.sol'; | |
import './EthicHubReputationInterface.sol'; | |
contract EthicHubReputation is EthicHubBase, EthicHubReputationInterface { | |
//10 with 2 decilmals | |
uint maxReputation = 1000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rc = Rc_{p} - Rc_{p} · \frac{d}{d_{max} } | |
Dln = Rln_{p} · \frac{d}{d_{max} } | |
Rln =\begin{cases} Rln_{p} - Dln & Dln < 1\\Rln_{p} - 1 & Dln >= 1\end{cases} | |
P_{a} = t_{n}·C | |
Rc = Rc_{p} + \frac{1}{N_{t_{n}} | |
NewerOlder