Skip to content

Commit

Permalink
redeploy with Permit2Vault inherited, but not used
Browse files Browse the repository at this point in the history
  • Loading branch information
lorbke committed Nov 16, 2024
1 parent 7a78cb5 commit 754c393
Show file tree
Hide file tree
Showing 7 changed files with 481 additions and 31 deletions.
60 changes: 60 additions & 0 deletions packages/foundry/broadcast/Deploy.s.sol/480/run-1731797931.json

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ pragma solidity ^0.8.28;

import {IWorldID} from "../lib/world-id-onchain-template/contracts/src/interfaces/IWorldID.sol";
import {WorldIdRegister} from "./WorldIdRegister.sol";
import {Permit2Vault} from "./Permit2Vault.sol";
import {ByteHasher} from "./ByteHasher.sol";
// import "forge-std/console.sol";

contract HumanOracleWithWorldIdRegister is WorldIdRegister {
contract HumanOracleV1 is WorldIdRegister, Permit2Vault {

// ====================
// ====== Structs =====
Expand Down Expand Up @@ -99,7 +100,7 @@ contract HumanOracleWithWorldIdRegister is WorldIdRegister {
// === Constructor ====
// ====================

constructor(address _worldIdAddr, uint256 _groupId, string memory _appId, string memory _action) WorldIdRegister(_worldIdAddr, _groupId, _appId, _action) {
constructor(address _worldIdAddr, uint256 _groupId, string memory _appId, string memory _action, address _permit, address _owner) WorldIdRegister(_worldIdAddr, _groupId, _appId, _action) Permit2Vault(_permit, _owner) {
}

// ====================
Expand Down
6 changes: 3 additions & 3 deletions packages/foundry/script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { DeployMockHumanOracle } from "./DeployMockHumanOracle.s.sol";
import { DeployHumanOracle } from "./DeployHumanOracle.s.sol";
import { DeployHumanOracleWithVault } from "./DeployHumanOracleWithVault.s.sol";
import { DeployWorldIDRegister } from "./DeployWorldIDRegister.s.sol";
import { DeployHumanOracleWithWorldIdRegister } from "./DeployHumanOracleWithWorldIdRegister.s.sol";
import { DeployHumanOracleV1 } from "./DeployHumanOracleV1.s.sol";

contract DeployScript is ScaffoldETHDeploy {
function run() external {
Expand All @@ -19,8 +19,8 @@ contract DeployScript is ScaffoldETHDeploy {
// DeployHumanOracleWithVault deployHumanOracleWithVault = new DeployHumanOracleWithVault();
// deployHumanOracleWithVault.run();

DeployHumanOracleWithWorldIdRegister deployHumanOracleWithWorldIdRegister = new DeployHumanOracleWithWorldIdRegister();
deployHumanOracleWithWorldIdRegister.run();
DeployHumanOracleV1 deployHumanOracleV1 = new DeployHumanOracleV1();
deployHumanOracleV1.run();

// DeployWorldIDRegister worldIDregister = new DeployWorldIDRegister();
// worldIDregister.run();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import "../contracts/HumanOracleWithWorldIdRegister.sol";
import "../contracts/HumanOracleV1.sol";
import "./DeployHelpers.s.sol";

contract DeployHumanOracleWithWorldIdRegister is ScaffoldETHDeploy {
contract DeployHumanOracleV1 is ScaffoldETHDeploy {

address public worldIdAddr = 0x17B354dD2595411ff79041f930e491A4Df39A278;
uint256 public groupId = 1;
string public appId = "app_22ea9fb73d53333c2997e8f16e60cc6b";
string public action = "registration";
address public worldToken = 0x2cFc85d8E48F8EAB294be644d9E25C3030863003;
address public permit = 0x000000000022D473030F116dDEE9F6B43aC78BA3;
address public owner = 0x4639B9F663C14Bad89Ddcc16966e85Bc81dCCD40;

function run() external ScaffoldEthDeployerRunner {
HumanOracleWithWorldIdRegister humanOracle = new HumanOracleWithWorldIdRegister(worldIdAddr, groupId, appId, action);
HumanOracleV1 humanOracle = new HumanOracleV1(worldIdAddr, groupId, appId, action, permit, owner);
console.logString(
string.concat(
"HumanOracleWithWorldIdRegister deployed at: ", vm.toString(address(humanOracle))
Expand Down
196 changes: 194 additions & 2 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: {
HumanOracleWithWorldIdRegister: {
address: "0x5d3ea2d21cd19deaaebcb9a9eb8acd708e2dea2f",
HumanOracleV1: {
address: "0x7447696e22c7074683c4ebcc53d3321939f3b403",
abi: [
{
type: "constructor",
Expand All @@ -314,9 +314,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 +392,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 +610,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 @@ -591,6 +683,43 @@ const deployedContracts = {
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 @@ -615,6 +744,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 @@ -628,6 +775,25 @@ const deployedContracts = {
],
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 @@ -740,11 +906,37 @@ 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: {
signUpWithWorldId: "contracts/WorldIdRegister.sol",
users: "contracts/WorldIdRegister.sol",
worldId: "contracts/WorldIdRegister.sol",
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",
},
},
},
Expand Down
Loading

0 comments on commit 754c393

Please sign in to comment.