Skip to content

Commit

Permalink
redeploy HumanOracle
Browse files Browse the repository at this point in the history
  • Loading branch information
lorbke committed Nov 16, 2024
1 parent 6770434 commit 6fb4f13
Show file tree
Hide file tree
Showing 10 changed files with 495 additions and 42 deletions.
53 changes: 53 additions & 0 deletions packages/foundry/broadcast/Deploy.s.sol/480/run-1731766637.json

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions packages/foundry/broadcast/Deploy.s.sol/480/run-1731766751.json

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions packages/foundry/broadcast/Deploy.s.sol/480/run-1731766959.json

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions packages/foundry/broadcast/Deploy.s.sol/480/run-1731767098.json

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions packages/foundry/broadcast/Deploy.s.sol/480/run-1731767191.json

Large diffs are not rendered by default.

45 changes: 25 additions & 20 deletions packages/foundry/broadcast/Deploy.s.sol/480/run-latest.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions packages/foundry/contracts/MockHumanOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.28;

// Useful for debugging. Remove when deploying to a live network.
// import "forge-std/console.sol";
import "forge-std/console.sol";

contract MockHumanOracle {
// ====================
Expand Down Expand Up @@ -132,14 +132,14 @@ contract MockHumanOracle {
string[] memory questions,
uint256[] memory totalStakes
) {
uint256 numberOfVotes = 2;
uint256 numberOfVotes = 2;
ids = new uint256[](numberOfVotes);
questions = new string[](numberOfVotes);
totalStakes = new uint256[](numberOfVotes);
totalStakes = new uint256[](numberOfVotes);

ids[0] = 1;
questions[0] = "What is your favorite blockchain?";
totalStakes[0] = 1000;
totalStakes[0] = 1000;

ids[1] = 2;
questions[1] = "Which DeFi project do you trust the most?";
Expand Down
8 changes: 4 additions & 4 deletions packages/foundry/script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { DeployHumanOracle } from "./DeployHumanOracle.s.sol";

contract DeployScript is ScaffoldETHDeploy {
function run() external {
DeployMockHumanOracle deployMockHumanOracle = new DeployMockHumanOracle();
deployMockHumanOracle.run();
// DeployMockHumanOracle deployMockHumanOracle = new DeployMockHumanOracle();
// deployMockHumanOracle.run();

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

// deploy more contracts here
// DeployMyContract deployMyContract = new DeployMyContract();
Expand Down
102 changes: 95 additions & 7 deletions packages/nextjs-app/src/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,35 @@ const deployedContracts = {
},
},
480: {
MockHumanOracle: {
address: "0x5b48d6c49c2be6a0290bfc1756c700891861d3be",
HumanOracle: {
address: "0xd458ac0643add160a344b94b2dd165e6acb3bed5",
abi: [
{
type: "constructor",
inputs: [
{
name: "_worldIdAddr",
type: "address",
internalType: "address",
},
{
name: "_groupId",
type: "uint256",
internalType: "uint256",
},
{
name: "_appId",
type: "string",
internalType: "string",
},
{
name: "_action",
type: "string",
internalType: "string",
},
],
stateMutability: "nonpayable",
},
{
type: "function",
name: "claimRewardForVote",
Expand All @@ -301,7 +327,13 @@ const deployedContracts = {
internalType: "uint256",
},
],
outputs: [],
outputs: [
{
name: "",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "nonpayable",
},
{
Expand Down Expand Up @@ -353,7 +385,7 @@ const deployedContracts = {
internalType: "uint256[]",
},
],
stateMutability: "pure",
stateMutability: "view",
},
{
type: "function",
Expand Down Expand Up @@ -387,7 +419,7 @@ const deployedContracts = {
internalType: "uint256[]",
},
],
stateMutability: "pure",
stateMutability: "view",
},
{
type: "function",
Expand All @@ -406,7 +438,7 @@ const deployedContracts = {
internalType: "bool",
},
],
stateMutability: "pure",
stateMutability: "view",
},
{
type: "function",
Expand All @@ -431,6 +463,25 @@ const deployedContracts = {
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "stakesForVoteIds",
inputs: [
{
name: "",
type: "uint256",
internalType: "uint256",
},
],
outputs: [
{
name: "totalStake",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "view",
},
{
type: "function",
name: "submitVotingDecisionWithStake",
Expand All @@ -446,14 +497,51 @@ const deployedContracts = {
internalType: "uint256",
},
{
name: "stake",
name: "amount",
type: "uint256",
internalType: "uint256",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "users",
inputs: [
{
name: "",
type: "address",
internalType: "address",
},
],
outputs: [
{
name: "nullifierHash",
type: "uint256",
internalType: "uint256",
},
{
name: "createdAtBlock",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "view",
},
{
type: "function",
name: "worldId",
inputs: [],
outputs: [
{
name: "",
type: "address",
internalType: "contract IWorldID",
},
],
stateMutability: "view",
},
{
type: "event",
name: "RewardClaimed",
Expand Down
102 changes: 95 additions & 7 deletions packages/nextjs/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,35 @@ const deployedContracts = {
},
},
480: {
MockHumanOracle: {
address: "0x5b48d6c49c2be6a0290bfc1756c700891861d3be",
HumanOracle: {
address: "0xd458ac0643add160a344b94b2dd165e6acb3bed5",
abi: [
{
type: "constructor",
inputs: [
{
name: "_worldIdAddr",
type: "address",
internalType: "address",
},
{
name: "_groupId",
type: "uint256",
internalType: "uint256",
},
{
name: "_appId",
type: "string",
internalType: "string",
},
{
name: "_action",
type: "string",
internalType: "string",
},
],
stateMutability: "nonpayable",
},
{
type: "function",
name: "claimRewardForVote",
Expand All @@ -302,7 +328,13 @@ const deployedContracts = {
internalType: "uint256",
},
],
outputs: [],
outputs: [
{
name: "",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "nonpayable",
},
{
Expand Down Expand Up @@ -354,7 +386,7 @@ const deployedContracts = {
internalType: "uint256[]",
},
],
stateMutability: "pure",
stateMutability: "view",
},
{
type: "function",
Expand Down Expand Up @@ -388,7 +420,7 @@ const deployedContracts = {
internalType: "uint256[]",
},
],
stateMutability: "pure",
stateMutability: "view",
},
{
type: "function",
Expand All @@ -407,7 +439,7 @@ const deployedContracts = {
internalType: "bool",
},
],
stateMutability: "pure",
stateMutability: "view",
},
{
type: "function",
Expand All @@ -432,6 +464,25 @@ const deployedContracts = {
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "stakesForVoteIds",
inputs: [
{
name: "",
type: "uint256",
internalType: "uint256",
},
],
outputs: [
{
name: "totalStake",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "view",
},
{
type: "function",
name: "submitVotingDecisionWithStake",
Expand All @@ -447,14 +498,51 @@ const deployedContracts = {
internalType: "uint256",
},
{
name: "stake",
name: "amount",
type: "uint256",
internalType: "uint256",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "users",
inputs: [
{
name: "",
type: "address",
internalType: "address",
},
],
outputs: [
{
name: "nullifierHash",
type: "uint256",
internalType: "uint256",
},
{
name: "createdAtBlock",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "view",
},
{
type: "function",
name: "worldId",
inputs: [],
outputs: [
{
name: "",
type: "address",
internalType: "contract IWorldID",
},
],
stateMutability: "view",
},
{
type: "event",
name: "RewardClaimed",
Expand Down

0 comments on commit 6fb4f13

Please sign in to comment.