Skip to content
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
2 changes: 2 additions & 0 deletions contracts/identity/IdentityV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ contract IdentityV3 is
string public constant TYPED_STRUCTURE =
"ConnectIdentity(address whitelisted,address connected,uint256 deadline)";

/* @dev rough estimate of number of whitelisted addresses */
uint256 public whitelistedCount;
uint256 public whitelistedContracts;
uint256 public authenticationPeriod;
Expand Down Expand Up @@ -236,6 +237,7 @@ contract IdentityV3 is
function addBlacklisted(
address account
) public onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
_removeWhitelisted(account);
identities[account].status = 255;
emit BlacklistAdded(account);
}
Expand Down
18 changes: 16 additions & 2 deletions contracts/reserve/GenericDistributionHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ contract GenericDistributionHelper is

address public reserveToken;

uint256 private _status; //for reentrancy guard

event Distribution(
uint256 distributed,
uint256 startingBalance,
Expand All @@ -76,6 +78,18 @@ contract GenericDistributionHelper is

receive() external payable {}

modifier nonReentrant() {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != 1, "ReentrancyGuard: reentrant call");

// Any calls to nonReentrant after this point will fail
_status = 1;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = 0;
}

function initialize(
INameService _ns,
IStaticOracle _oracle,
Expand Down Expand Up @@ -129,7 +143,7 @@ contract GenericDistributionHelper is
* @notice this is usually called by reserve, but can be called by anyone anytime to trigger distribution
* @param _amount how much was sent, informational only
*/
function onDistribution(uint256 _amount) external virtual {
function onDistribution(uint256 _amount) external virtual nonReentrant {
//we consider the actual balance and not _amount
uint256 toDistribute = nativeToken().balanceOf(address(this));
if (toDistribute == 0) return;
Expand Down Expand Up @@ -300,7 +314,7 @@ contract GenericDistributionHelper is
}
for (uint i = 1; i < gdPools.length; i++) {
uint24 fee = IUniswapV3Pool(gdPools[i]).fee();
gdFee = gasFee < fee ? gasFee : fee;
gdFee = gdFee < fee ? gdFee : fee;
}
ERC20(nativeToken()).approve(address(ROUTER), amountToSell);
uint256 amountOutMinimum = (minReceived * (100 - feeSettings.maxSlippage)) /
Expand Down
12 changes: 2 additions & 10 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const MAINNET_URL = "https://mainnet.infura.io/v3/" + infura_api;

const xdc = {
accounts: { mnemonic },
url: "https://rpc.ankr.com/xdc/ef07ba6590dc46db9275bba237aed203ed6d5fb3e3203ff237a82a841f75b2ce",
url: "https://rpc.ankr.com/xdc",
gas: 3000000,
gasPrice: 12.5e9,
chainId: 50
Expand All @@ -65,15 +65,7 @@ const hhconfig: HardhatUserConfig = {
enabled: true
},
etherscan: {
apiKey: {
mainnet: etherscan_key,
txdc: etherscan_key,
xdc: etherscan_key,
celo: etherscan_key,
alfajores: celoscan_key,
base: basescan_key,
fuse: etherscan_key
},
apiKey: etherscan_key,
customChains: [
{
network: "fuse",
Expand Down
4 changes: 3 additions & 1 deletion releases/deployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,8 @@
"AdminWallet": "0x66fc1bE551f752706130b6f54d84141F8c2Ae8Bb",
"Faucet": "0x7344Da1Be296f03fbb8082aDaC5696058B5a9bd9",
"Invites": "0x6bd698566632bf2e81e2278f1656CB24aAF06D2e",
"UBIScheme": "0x22867567E2D80f2049200E25C6F31CB6Ec2F0faf"
"UBIScheme": "0x22867567E2D80f2049200E25C6F31CB6Ec2F0faf",
"MpbBridge": "0xa3247276DbCC76Dd7705273f766eB3E8a5ecF4a5",
"BulkWhitelist": "0xe8861A20452Db53dF685F1d9e6B7017de3DB0E46"
}
}
7 changes: 6 additions & 1 deletion scripts/multichain-deploy/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { TransactionResponse, TransactionReceipt } from "@ethersproject/provider
import { getImplementationAddress } from "@openzeppelin/upgrades-core";

import SafeApiKit from "@safe-global/api-kit";
import Safe from "@safe-global/protocol-kit";
import Safe, { SafeTransactionOptionalProps } from "@safe-global/protocol-kit";
import { MetaTransactionData } from "@safe-global/types-kit";

import util from "util";
Expand Down Expand Up @@ -357,6 +357,7 @@ export const executeViaSafe = async (
functionInputs,
safeAddress: string,
safeSignerOrNetwork?: Signer | string,
safeOptions: SafeTransactionOptionalProps = {},
isSimulation = false
) => {
if (typeof safeSignerOrNetwork !== "object" && !process.env.SAFEOWNER_PRIVATE_KEY) {
Expand Down Expand Up @@ -387,6 +388,10 @@ export const executeViaSafe = async (
// new ethers.providers.JsonRpcProvider("https://rpc.fuse.io")
// );
break;
case "xdc":
chainId = 50;
provider = "https://rpc.xdcrpc.com";
break;
}
} else if (safeSignerOrNetwork) {
// safeSigner = safeSignerOrNetwork as any;
Expand Down
Loading
Loading