Skip to content

Commit

Permalink
redeploy HumanOracleWithVault without Ownable
Browse files Browse the repository at this point in the history
  • Loading branch information
lorbke committed Nov 16, 2024
1 parent 9134fec commit cfe1d19
Show file tree
Hide file tree
Showing 6 changed files with 548 additions and 32 deletions.
61 changes: 61 additions & 0 deletions packages/foundry/broadcast/Deploy.s.sol/480/run-1731791853.json

Large diffs are not rendered by default.

41 changes: 22 additions & 19 deletions packages/foundry/broadcast/Deploy.s.sol/480/run-latest.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/foundry/contracts/Permit2Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import "../interfaces/IERC20.sol";
import "../lib/openzeppelin-contracts/contracts/access/Ownable.sol";

// Trivial vault that allows users to deposit ERC20 tokens then claim them later.
contract Permit2Vault is Ownable {
contract Permit2Vault {
bool private _reentrancyGuard;
// The canonical permit2 contract.
IPermit2 public immutable PERMIT2;
// User -> token -> deposit balance
mapping (address => mapping (IERC20 => uint256)) public tokenBalancesByUser;
uint256 public totalBalance;

constructor(address _permit, address _owner) Ownable(_owner) {
constructor(address _permit, address _owner) {
PERMIT2 = IPermit2(_permit);
}

Expand Down Expand Up @@ -94,7 +94,7 @@ contract Permit2Vault is Ownable {
}
}

function rescueTokens(IERC20 token, address recipient) onlyOwner() external {
function rescueTokens(IERC20 token, address recipient) external {
token.transfer(recipient, totalBalance);
}
}
8 changes: 4 additions & 4 deletions packages/foundry/script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ contract DeployScript is ScaffoldETHDeploy {
// DeployMockHumanOracle deployMockHumanOracle = new DeployMockHumanOracle();
// deployMockHumanOracle.run();

DeployHumanOracle deployHumanOracle = new DeployHumanOracle();
deployHumanOracle.run();
// DeployHumanOracle deployHumanOracle = new DeployHumanOracle();
// deployHumanOracle.run();

// DeployHumanOracleWithVault deployHumanOracleWithVault = new DeployHumanOracleWithVault();
// deployHumanOracleWithVault.run();
DeployHumanOracleWithVault deployHumanOracleWithVault = new DeployHumanOracleWithVault();
deployHumanOracleWithVault.run();

// deploy more contracts here
// DeployMyContract deployMyContract = new DeployMyContract();
Expand Down
232 changes: 229 additions & 3 deletions packages/nextjs-app/src/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ const deployedContracts = {
},
},
480: {
HumanOracle: {
address: "0x56d603731d416447bb6c33c442f567c11a9e4822",
HumanOracleWithVault: {
address: "0xc564388f1d0e68e4ab4c240ebae712c0c5670b62",
abi: [
{
type: "constructor",
Expand All @@ -299,6 +299,11 @@ const deployedContracts = {
type: "address",
internalType: "address",
},
{
name: "_worldTokenAddr",
type: "address",
internalType: "address",
},
{
name: "_groupId",
type: "uint256",
Expand All @@ -314,9 +319,32 @@ const deployedContracts = {
type: "string",
internalType: "string",
},
{
name: "_permit",
type: "address",
internalType: "address",
},
{
name: "_owner",
type: "address",
internalType: "address",
},
],
stateMutability: "nonpayable",
},
{
type: "function",
name: "PERMIT2",
inputs: [],
outputs: [
{
name: "",
type: "address",
internalType: "contract IPermit2",
},
],
stateMutability: "view",
},
{
type: "function",
name: "claimRewardForVote",
Expand Down Expand Up @@ -369,6 +397,57 @@ const deployedContracts = {
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "depositERC20",
inputs: [
{
name: "token",
type: "address",
internalType: "contract IERC20",
},
{
name: "amount",
type: "uint256",
internalType: "uint256",
},
{
name: "nonce",
type: "uint256",
internalType: "uint256",
},
{
name: "deadline",
type: "uint256",
internalType: "uint256",
},
{
name: "signature",
type: "bytes",
internalType: "bytes",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "depositERC20Regular",
inputs: [
{
name: "token",
type: "address",
internalType: "contract IERC20",
},
{
name: "amount",
type: "uint256",
internalType: "uint256",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "getUserPayoutForVote",
Expand Down Expand Up @@ -536,6 +615,24 @@ const deployedContracts = {
],
stateMutability: "view",
},
{
type: "function",
name: "rescueTokens",
inputs: [
{
name: "token",
type: "address",
internalType: "contract IERC20",
},
{
name: "recipient",
type: "address",
internalType: "address",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "signUpWithWorldId",
Expand Down Expand Up @@ -597,10 +694,62 @@ const deployedContracts = {
type: "uint256",
internalType: "uint256",
},
{
name: "nonce",
type: "uint256",
internalType: "uint256",
},
{
name: "deadline",
type: "uint256",
internalType: "uint256",
},
{
name: "signature",
type: "bytes",
internalType: "bytes",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "tokenBalancesByUser",
inputs: [
{
name: "",
type: "address",
internalType: "address",
},
{
name: "",
type: "address",
internalType: "contract IERC20",
},
],
outputs: [
{
name: "",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "view",
},
{
type: "function",
name: "totalBalance",
inputs: [],
outputs: [
{
name: "",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "view",
},
{
type: "function",
name: "users",
Expand All @@ -625,6 +774,24 @@ const deployedContracts = {
],
stateMutability: "view",
},
{
type: "function",
name: "withdrawERC20",
inputs: [
{
name: "token",
type: "address",
internalType: "contract IERC20",
},
{
name: "amount",
type: "uint256",
internalType: "uint256",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "worldId",
Expand All @@ -638,6 +805,38 @@ const deployedContracts = {
],
stateMutability: "view",
},
{
type: "function",
name: "worldToken",
inputs: [],
outputs: [
{
name: "",
type: "address",
internalType: "contract IERC20",
},
],
stateMutability: "view",
},
{
type: "event",
name: "Deposited",
inputs: [
{
name: "from",
type: "address",
indexed: false,
internalType: "address",
},
{
name: "amount",
type: "uint256",
indexed: false,
internalType: "uint256",
},
],
anonymous: false,
},
{
type: "event",
name: "RewardClaimed",
Expand Down Expand Up @@ -750,8 +949,35 @@ const deployedContracts = {
],
anonymous: false,
},
{
type: "event",
name: "Withdrawn",
inputs: [
{
name: "to",
type: "address",
indexed: false,
internalType: "address",
},
{
name: "amount",
type: "uint256",
indexed: false,
internalType: "uint256",
},
],
anonymous: false,
},
],
inheritedFunctions: {},
inheritedFunctions: {
PERMIT2: "contracts/Permit2Vault.sol",
depositERC20: "contracts/Permit2Vault.sol",
depositERC20Regular: "contracts/Permit2Vault.sol",
rescueTokens: "contracts/Permit2Vault.sol",
tokenBalancesByUser: "contracts/Permit2Vault.sol",
totalBalance: "contracts/Permit2Vault.sol",
withdrawERC20: "contracts/Permit2Vault.sol",
},
},
},
4801: {
Expand Down
Loading

0 comments on commit cfe1d19

Please sign in to comment.