Compare commits

..

No commits in common. "main" and "mobileVersion" have entirely different histories.

521 changed files with 321 additions and 135598 deletions

3
.gitmodules vendored
View File

@ -4,6 +4,3 @@
[submodule "lib/openzeppelin-contracts"] [submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/Baal"]
path = lib/Baal
url = https://github.com/HausDAO/Baal

15
app/package-lock.json generated
View File

@ -11,8 +11,6 @@
"@next/eslint-plugin-next": "^14.2.15", "@next/eslint-plugin-next": "^14.2.15",
"@rainbow-me/rainbowkit": "^2.2.0", "@rainbow-me/rainbowkit": "^2.2.0",
"@tanstack/react-query": "^5.55.3", "@tanstack/react-query": "^5.55.3",
"howler": "^2.2.4",
"jsfxr": "^1.2.2",
"next": "^14.2.10", "next": "^14.2.10",
"react": "^18.3.1", "react": "^18.3.1",
"react-dom": "^18.3.1", "react-dom": "^18.3.1",
@ -8976,11 +8974,6 @@
"minimalistic-crypto-utils": "^1.0.1" "minimalistic-crypto-utils": "^1.0.1"
} }
}, },
"node_modules/howler": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/howler/-/howler-2.2.4.tgz",
"integrity": "sha512-iARIBPgcQrwtEr+tALF+rapJ8qSc+Set2GJQl7xT1MQzWaVkFebdJhR3alVlSiUf5U7nAANKuj3aWpwerocD5w=="
},
"node_modules/http-errors": { "node_modules/http-errors": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
@ -10124,14 +10117,6 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/jsfxr": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/jsfxr/-/jsfxr-1.2.2.tgz",
"integrity": "sha512-aBtNHZ/eJVZ3Q12HLj6F0eF20bRJTar6fjHf14zZ/Co5GzcVsEBujJO7IKwAhZS3Pe0xIvUOD3O1BoZ6ij0xhA==",
"bin": {
"sfxr-to-wav": "sfxr-to-wav"
}
},
"node_modules/json-buffer": { "node_modules/json-buffer": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",

View File

@ -12,8 +12,6 @@
"@next/eslint-plugin-next": "^14.2.15", "@next/eslint-plugin-next": "^14.2.15",
"@rainbow-me/rainbowkit": "^2.2.0", "@rainbow-me/rainbowkit": "^2.2.0",
"@tanstack/react-query": "^5.55.3", "@tanstack/react-query": "^5.55.3",
"howler": "^2.2.4",
"jsfxr": "^1.2.2",
"next": "^14.2.10", "next": "^14.2.10",
"react": "^18.3.1", "react": "^18.3.1",
"react-dom": "^18.3.1", "react-dom": "^18.3.1",

Binary file not shown.

Binary file not shown.

View File

@ -25,13 +25,13 @@ export const bossToName: Record<BossLevel, string> = {
} }
export const bossToReward: Record<BossLevel, bigint> = { export const bossToReward: Record<BossLevel, bigint> = {
0: BigInt("129600000000000000"), 0: BigInt("200000000000000000"),
1: BigInt("18321824160000000000"), 1: BigInt("28274420000000000000"),
2: BigInt("112876175462400000000"), 2: BigInt("174191628800000000000"),
3: BigInt("332589044376576000000"), 3: BigInt("513254698112000000000"),
4: BigInt("624347914175155814400"), 4: BigInt("963499867554252800000"),
5: BigInt("923147774241822027325"), 5: BigInt("1424610762718861153000"),
6: BigInt("1139287879845155524372"), 6: BigInt("1758160308403017784500"),
} }
// for boss chances (percent) [99, 89, 80, 70, 62, 51, 40] // for boss chances (percent) [99, 89, 80, 70, 62, 51, 40]

View File

@ -4,76 +4,38 @@ import styles from "../styles/Modal.module.css";
import bgStyles from "../styles/Background.module.css"; import bgStyles from "../styles/Background.module.css";
import { bossToName, bossToReward } from "./BossInfo"; import { bossToName, bossToReward } from "./BossInfo";
import { bossLevelToClass } from "./Boss"; import { bossLevelToClass } from "./Boss";
import { lostSound, wonSound } from "../utils/soundsEffect";
import { useEffect } from "react";
interface BossOutcomeModalProps { interface BossOutcomeModalProps {
setIsOpen: (val: boolean) => void; setIsOpen: (val: boolean) => void,
} }
const BossOutcomeModal = ({ setIsOpen }: BossOutcomeModalProps) => { const BossOutcomeModal = ({ setIsOpen }: BossOutcomeModalProps) => {
const { lastBossResult } = usePlayer(); const { lastBossResult } = usePlayer();
const outcome = lastBossResult?.reward != BigInt(0);
const ascended = lastBossResult?.prestigeGained;
useEffect(() => {
if (lastBossResult != null) {
if (outcome) {
wonSound();
} else {
lostSound();
}
}
}, [outcome, lastBossResult])
if (lastBossResult == null) return null; if (lastBossResult == null) return null;
const text = outcome ? ( const outcome = lastBossResult.reward != BigInt(0);
<span> const ascended = lastBossResult.prestigeGained;
and you <strong className={styles.won}>won!</strong> 🤩
</span> const text = outcome ? <span>and you <strong className={styles.won}>won!</strong> 🤩</span> : <span>and you <strong className={styles.lost}>lost</strong> 😔</span>;
) : ( const rewardAmount = parseFloat(parseFloat(formatUnits(bossToReward[lastBossResult.level], 18).toString()).toFixed(4));
<span> const rewardText =
and you <strong className={styles.lost}>lost</strong> 😔 ascended ? <p>You won <strong>{rewardAmount} RGCVII</strong> and <strong>ASCENDED!!!</strong>. This means you beat the bosses and gained a <strong>Prestige level</strong>. Your GELD is now forfeit, but your legend lives on.</p>
</span> : outcome ? <p>You won <strong>{rewardAmount} RGCVII</strong></p>
); : <p>Your GELD is now forfeit.<br />Try again 💪 we know you can do it!</p>
const rewardAmount = parseFloat(
parseFloat(
formatUnits(bossToReward[lastBossResult.level], 18).toString()
).toFixed(4)
);
const rewardText = ascended ? (
<p>
You won <strong>{rewardAmount} RGCVII</strong> and{" "}
<strong>ASCENDED!!!</strong>. This means you beat the bosses and gained a{" "}
<strong>Prestige level</strong>. Your GELD is now forfeit, but your legend
lives on.
</p>
) : outcome ? (
<p>
You won <strong>{rewardAmount} RGCVII</strong>
</p>
) : (
<p>
Your GELD is now forfeit.
<br />
Try again 💪 we know you can do it!
</p>
);
const bossName = bossToName[lastBossResult.variant]; const bossName = bossToName[lastBossResult.variant];
const bossClass = bossLevelToClass[lastBossResult.variant]; const bossClass = bossLevelToClass[lastBossResult.variant];
return ( return <div className={`${styles.modal} ${styles.bossModal}`}>
<div className={`${styles.modal} ${styles.bossModal}`}> <h2>You battled {bossName} Moloch!</h2>
<h2>You battled {bossName} Moloch!</h2> <div className={`${bgStyles.boss} ${bossClass} ${styles.image}`} />
<div className={`${bgStyles.boss} ${bossClass} ${styles.image}`} /> <p className={styles.outcome}>{text}</p>
<p className={styles.outcome}>{text}</p> {rewardText}
{rewardText} <div>
<div> <button onClick={() => setIsOpen(false)}>Onward!</button>
<button onClick={() => setIsOpen(false)}>Onward!</button>
</div>
</div> </div>
); </div>
}; }
export default BossOutcomeModal; export default BossOutcomeModal

View File

@ -1,85 +0,0 @@
import { useEffect, useState } from 'react';
import styles from '../styles/Dashboard.module.css';
interface MetricsData {
totalPlayers: number;
totalRuns: number;
activePlayers24h: number;
totalBossesDefeated: number;
totalPrestigeLevels: number;
}
const SUBGRAPH_URL = "https://api.studio.thegraph.com/query/75782/slay-the-moloch-base-mainnet/version/latest";
const Dashboard = () => {
const [metrics, setMetrics] = useState<MetricsData>();
useEffect(() => {
const fetchMetrics = async () => {
try {
const response = await fetch(SUBGRAPH_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
query: `{
# Get global stats
globalStat(id: "1") {
totalPlayers
totalBossesDefeated
totalPrestigeLevels
totalRuns
}
# Get active players in last 24h
players(where: { lastRaidedAt_gt: "${Math.floor(Date.now() / 1000) - 86400}" }) {
id
}
}`
})
});
const data = await response.json();
setMetrics({
totalPlayers: parseInt(data.data.globalStat.totalPlayers),
totalRuns: parseInt(data.data.globalStat.totalRuns),
activePlayers24h: data.data.players.length,
totalBossesDefeated: parseInt(data.data.globalStat.totalBossesDefeated),
totalPrestigeLevels: parseInt(data.data.globalStat.totalPrestigeLevels)
});
} catch (error) {
console.error("Error fetching metrics:", error);
}
};
fetchMetrics();
const interval = setInterval(fetchMetrics, 30000); // Refresh every 30 seconds
return () => clearInterval(interval);
}, []);
return (
<div className={styles.dashboard}>
<div className={styles.metric}>
<h3>Total Players</h3>
<p>{metrics?.totalPlayers || 0}</p>
</div>
<div className={styles.metric}>
<h3>Total Game Runs</h3>
<p>{metrics?.totalRuns || 0}</p>
</div>
<div className={styles.metric}>
<h3>Active Players (24h)</h3>
<p>{metrics?.activePlayers24h || 0}</p>
</div>
<div className={styles.metric}>
<h3>Total Bosses Defeated</h3>
<p>{metrics?.totalBossesDefeated || 0}</p>
</div>
<div className={styles.metric}>
<h3>Total Prestige Levels</h3>
<p>{metrics?.totalPrestigeLevels || 0}</p>
</div>
</div>
);
};
export default Dashboard;

View File

@ -1,33 +1,24 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from 'react'
import styles from "../styles/Leaderboard.module.css"; import styles from '../styles/Leaderboard.module.css'
import { import { TopEarnersResponse, TopRaidersResponse } from '../types/leaderboard'
TopEarnersResponse, import { formatUnits } from 'viem'
TopRaidersResponse,
PlayerResponse,
} from "../types/leaderboard";
import { formatUnits } from "viem";
const SUBGRAPH_URL = const SUBGRAPH_URL = 'https://api.studio.thegraph.com/query/75782/slay-the-moloch-base-sepolia/version/latest'
"https://api.studio.thegraph.com/query/75782/slay-the-moloch-base-mainnet/version/latest";
const Leaderboard = () => { const Leaderboard = () => {
const [topEarners, setTopEarners] = useState<TopEarnersResponse>(); const [topEarners, setTopEarners] = useState<TopEarnersResponse>()
const [topRaiders, setTopRaiders] = useState<TopRaidersResponse>(); const [topRaiders, setTopRaiders] = useState<TopRaidersResponse>()
const [activeTab, setActiveTab] = useState< const [activeTab, setActiveTab] = useState<'earners' | 'raiders'>('earners')
"earners" | "raiders" | "bosses" | "prestige"
>("earners");
const [bossesDefeated, setBossesDefeated] = useState<PlayerResponse>();
const [playerPrestige, setPlayerPrestige] = useState<PlayerResponse>();
useEffect(() => { useEffect(() => {
const fetchLeaderboards = async () => { const fetchLeaderboards = async () => {
try { try {
// Fetch top earners // Fetch top earners
const earnersResponse = await fetch(SUBGRAPH_URL, { const earnersResponse = await fetch(SUBGRAPH_URL, {
method: "POST", method: 'POST',
headers: { "Content-Type": "application/json" }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ body: JSON.stringify({
query: `{ query: `{
armies(first: 10, orderBy: profitPerSecond, orderDirection: desc) { armies(first: 10, orderBy: profitPerSecond, orderDirection: desc) {
player { player {
id id
@ -41,177 +32,83 @@ const Leaderboard = () => {
anointedLevel anointedLevel
championLevel championLevel
} }
}`, }`
}), })
}); })
const earnersData = await earnersResponse.json(); const earnersData = await earnersResponse.json()
setTopEarners({ armies: earnersData.data.armies }); setTopEarners({ armies: earnersData.data.armies })
// Fetch top raiders // Fetch top raiders
const raidersResponse = await fetch(SUBGRAPH_URL, { const raidersResponse = await fetch(SUBGRAPH_URL, {
method: "POST", method: 'POST',
headers: { "Content-Type": "application/json" }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ body: JSON.stringify({
query: `{ query: `{
players(first: 10, orderBy: numberOfRaids, orderDirection: desc) { players(first: 10, orderBy: numberOfRaids, orderDirection: desc) {
id id
numberOfRaids numberOfRaids
totalMinted totalMinted
currentBalance currentBalance
} }
}`, }`
}), })
}); })
const raidersData = await raidersResponse.json(); const raidersData = await raidersResponse.json()
setTopRaiders({ players: raidersData.data.players }); setTopRaiders({ players: raidersData.data.players })
} catch (error) {
console.error('Error fetching leaderboard:', error)
}
}
// Fetch bosses defeated fetchLeaderboards()
const bossesDefeatedResponse = await fetch(SUBGRAPH_URL, { const interval = setInterval(fetchLeaderboards, 30000) // Refresh every 30 seconds
method: "POST", return () => clearInterval(interval)
headers: { "Content-Type": "application/json" }, }, [])
body: JSON.stringify({
query: `{
players(first: 10, orderBy: bossesDefeated, orderDirection: desc) {
id
bossesDefeated
}
}`,
}),
});
const bossesDefeatedData = await bossesDefeatedResponse.json();
setBossesDefeated({ players: bossesDefeatedData.data.players });
// Fetch player prestige return (
const playerPrestigeResponse = await fetch(SUBGRAPH_URL, { <div className={styles.leaderboard}>
method: "POST", <h2 className={styles.title}>Leaderboard</h2>
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ <div className={styles.tabs}>
query: `{ <button
players(first: 10, orderBy: prestigeLevel, orderDirection: desc) { className={`${styles.tab} ${activeTab === 'earners' ? styles.active : ''}`}
id onClick={() => setActiveTab('earners')}
prestigeLevel >
} Top Earners
}`, </button>
}), <button
}); className={`${styles.tab} ${activeTab === 'raiders' ? styles.active : ''}`}
const playerPrestigeData = await playerPrestigeResponse.json(); onClick={() => setActiveTab('raiders')}
setPlayerPrestige({ players: playerPrestigeData.data.players }); >
} catch (error) { Top Raiders
console.error("Error fetching leaderboard:", error); </button>
} </div>
};
fetchLeaderboards(); {activeTab === 'earners' && (
const interval = setInterval(fetchLeaderboards, 30000); // Refresh every 30 seconds <div className={styles.list}>
return () => clearInterval(interval); {topEarners?.armies.map((army, index) => (
}, []); <div key={army.player.id} className={styles.item}>
<span className={styles.rank}>#{index + 1}</span>
return ( <span className={styles.address}>{army.player.id.slice(0, 6)}...{army.player.id.slice(-4)}</span>
<div className={styles.leaderboard}> <span className={styles.stat}>{formatUnits(BigInt(army.profitPerSecond), 4)} GELD/s</span>
<h2 className={styles.title}>Leaderboard</h2>
<div className={styles.tabs}>
<button
className={`${styles.tab} ${
activeTab === "earners" ? styles.active : ""
}`}
onClick={() => setActiveTab("earners")}
>
Top Earners
</button>
<button
className={`${styles.tab} ${
activeTab === "raiders" ? styles.active : ""
}`}
onClick={() => setActiveTab("raiders")}
>
Top Raiders
</button>
<button
className={`${styles.tab} ${
activeTab === "bosses" ? styles.active : ""
}`}
onClick={() => setActiveTab("bosses")}
>
Top Boss Slayers
</button>
<button
className={`${styles.tab} ${
activeTab === "prestige" ? styles.active : ""
}`}
onClick={() => setActiveTab("prestige")}
>
Top Players by Prestige
</button>
</div> </div>
))}
{activeTab === "earners" && (
<div className={styles.list}>
{topEarners?.armies.map((army, index) => (
<div key={army.player.id} className={styles.item}>
<span className={styles.rank}>#{index + 1}</span>
<span className={styles.address}>
{army.player.id.slice(0, 6)}...
{army.player.id.slice(-4)}
</span>
<span className={styles.stat}>
{formatUnits(BigInt(army.profitPerSecond), 4)}{" "}
GELD/s
</span>
</div>
))}
</div>
)}
{activeTab === "raiders" && (
<div className={styles.list}>
{topRaiders?.players.map((player, index) => (
<div key={player.id} className={styles.item}>
<span className={styles.rank}>#{index + 1}</span>
<span className={styles.address}>
{player.id.slice(0, 6)}...{player.id.slice(-4)}
</span>
<span className={styles.stat}>
{player.numberOfRaids} raids
</span>
</div>
))}
</div>
)}
{activeTab === "bosses" && (
<div className={styles.list}>
{bossesDefeated?.players.map((player, index) => (
<div key={player.id} className={styles.item}>
<span className={styles.rank}>#{index + 1}</span>
<span className={styles.address}>
{player.id.slice(0, 6)}...{player.id.slice(-4)}
</span>
<span className={styles.stat}>
{player.bossesDefeated} Bosses Slain
</span>
</div>
))}
</div>
)}
{activeTab === "prestige" && (
<div className={styles.list}>
{playerPrestige?.players.map((player, index) => (
<div key={player.id} className={styles.item}>
<span className={styles.rank}>#{index + 1}</span>
<span className={styles.address}>
{player.id.slice(0, 6)}...{player.id.slice(-4)}
</span>
<span className={styles.stat}>
{player.prestigeLevel} Prestige Level
</span>
</div>
))}
</div>
)}
</div> </div>
); )}
};
export default Leaderboard; {activeTab === 'raiders' && (
<div className={styles.list}>
{topRaiders?.players.map((player, index) => (
<div key={player.id} className={styles.item}>
<span className={styles.rank}>#{index + 1}</span>
<span className={styles.address}>{player.id.slice(0, 6)}...{player.id.slice(-4)}</span>
<span className={styles.stat}>{player.numberOfRaids} raids</span>
</div>
))}
</div>
)}
</div>
)
}
export default Leaderboard

View File

@ -19,8 +19,8 @@ const RegistrationModal = ({ isOpen, setIsOpen }: RegistrationModalProps) => {
<span className={styles.closeBtn} onClick={() => setIsOpen(false)}>x</span> <span className={styles.closeBtn} onClick={() => setIsOpen(false)}>x</span>
<h2 className={styles.textCenter}>Insert coins to continue</h2> <h2 className={styles.textCenter}>Insert coins to continue</h2>
<div> <div>
<button onClick={() => onRegister("RGCVII")}>400 RGCVII</button> <button onClick={() => onRegister("RGCVII")}>500 RGCVII</button>
<button onClick={() => onRegister("ETH")}>0.00045 ETH</button> <button onClick={() => onRegister("ETH")}>0.0005 ETH</button>
</div> </div>
</div></div> </div></div>
} }

View File

@ -8,7 +8,6 @@ import Leaderboard from "./Leaderboard";
import { usePlayer } from "../providers/PlayerProvider"; import { usePlayer } from "../providers/PlayerProvider";
import Boss from "./Boss"; import Boss from "./Boss";
import BossInfo from "./BossInfo"; import BossInfo from "./BossInfo";
import Link from "next/link";
const bossToMountainsClass = { const bossToMountainsClass = {
0: styles.mountains0, 0: styles.mountains0,
@ -54,7 +53,6 @@ const Scene = () => {
> >
🏆 <span className={styles.hideMobile}>Top players</span> 🏆 <span className={styles.hideMobile}>Top players</span>
</button> </button>
<Link href="/metrics" className={styles.metricsButton}>📈 <span className={styles.hideMobile}>Game metrics</span></Link>
{isLeaderboardOpen && ( {isLeaderboardOpen && (
<div className={styles.leaderboardOverlay}> <div className={styles.leaderboardOverlay}>
<div className={styles.leaderboardContent}> <div className={styles.leaderboardContent}>

View File

@ -8,10 +8,8 @@ import { RainbowKitProvider, midnightTheme } from "@rainbow-me/rainbowkit";
import { config } from "../wagmi"; import { config } from "../wagmi";
import { Press_Start_2P, Texturina } from "next/font/google"; import { Press_Start_2P, Texturina } from "next/font/google";
import PlayerProvider from "../providers/PlayerProvider"; import PlayerProvider from "../providers/PlayerProvider";
import ModalProvider from "../providers/ModalProvider"; import ModalProvider from '../providers/ModalProvider';
import Script from "next/script";
import { useEffect } from "react";
import { clickSound } from "../utils/soundsEffect";
const client = new QueryClient(); const client = new QueryClient();
const font = Texturina({ weight: ["400"], subsets: ["latin"] }); const font = Texturina({ weight: ["400"], subsets: ["latin"] });
@ -20,18 +18,6 @@ const font = Texturina({ weight: ["400"], subsets: ["latin"] });
const fontPixel = Press_Start_2P({ weight: ["400"], subsets: ["latin"] }); const fontPixel = Press_Start_2P({ weight: ["400"], subsets: ["latin"] });
function MyApp({ Component, pageProps }: AppProps) { function MyApp({ Component, pageProps }: AppProps) {
useEffect(() => {
window.addEventListener("click", () => {
clickSound();
});
return () => {
window.removeEventListener("click", () => {
clickSound();
});
};
}, []);
return ( return (
<WagmiProvider config={config}> <WagmiProvider config={config}>
<QueryClientProvider client={client}> <QueryClientProvider client={client}>
@ -55,19 +41,11 @@ function MyApp({ Component, pageProps }: AppProps) {
font-family: ${font.style.fontFamily}; font-family: ${font.style.fontFamily};
} }
.pixelFont { .pixelFont {
font-family: ${fontPixel.style.fontFamily}; font-family: ${fontPixel.style.fontFamily};
} }
`}</style> `}</style>
<PlayerProvider> <PlayerProvider>
<ModalProvider> <ModalProvider>
<Script
src="https://sfxr.me/riffwave.js"
strategy="beforeInteractive"
/>
<Script
src="https://sfxr.me/sfxr.js"
strategy="beforeInteractive"
/>
<Component {...pageProps} /> <Component {...pageProps} />
</ModalProvider> </ModalProvider>
</PlayerProvider> </PlayerProvider>

View File

@ -1,15 +0,0 @@
import Dashboard from '../components/Dashboard';
import styles from '../styles/Metrics.module.css';
import Link from 'next/link';
const MetricsPage = () => {
return (
<div className={styles.metricsPage}>
<Link href="/" className={styles.backLink}> Back to game</Link>
<h1>Game Metrics</h1>
<Dashboard />
</div>
);
};
export default MetricsPage;

View File

@ -1,55 +1,38 @@
import React, { import React, { createContext, ReactNode, useCallback, useContext, useEffect, useRef, useState } from 'react'
createContext, import { useAccount, useReadContract, useWriteContract } from 'wagmi'
ReactNode, import contractAbi from "../../../out/RaidGeld.sol/RaidGeld.json"
useCallback, import { Hash, parseEther } from 'viem'
useContext, import contracts from '../../contract_address'
useEffect, import WaitingForTxModal from '../components/WaitingForTxModal'
useRef, import BossOutcomeModal from '../components/BossOutcomeModal'
useState, import styles from "../styles/Background.module.css"
} from "react";
import { useAccount, useReadContract, useWriteContract } from "wagmi";
import contractAbi from "../../../out/RaidGeld.sol/RaidGeld.json";
import { Hash, parseEther } from "viem";
import contracts from "../../contract_address";
import WaitingForTxModal from "../components/WaitingForTxModal";
import BossOutcomeModal from "../components/BossOutcomeModal";
import styles from "../styles/Background.module.css";
import { coinSound } from "../utils/soundsEffect";
const { contractAddress, daoTokenAddress } = contracts; const { contractAddress, daoTokenAddress } = contracts
const abi = contractAbi.abi; const abi = contractAbi.abi
export type UnitType = 0 | 1 | 2 | 3; export type UnitType = 0 | 1 | 2 | 3
export type BossLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6; export type BossLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6
export interface Player { export interface Player {
created_at: bigint; created_at: bigint,
last_raided_at: bigint; last_raided_at: bigint,
total_minted: bigint; total_minted: bigint
total_rewards: bigint; total_rewards: bigint,
n_runs: number; n_runs: number,
prestige_level: number; prestige_level: number,
is_registered: boolean; is_registered: boolean,
has_active_session: boolean; has_active_session: boolean,
} }
export interface Army { export interface Army {
anointed: { level: number }; anointed: { level: number }
apprentice: { level: number }; apprentice: { level: number }
champion: { level: number }; champion: { level: number }
moloch_denier: { level: number }; moloch_denier: { level: number }
profit_per_second: bigint; profit_per_second: bigint
} }
export interface Boss { export interface Boss {
level: BossLevel; level: BossLevel;
variants: [ variants: [BossLevel, BossLevel, BossLevel, BossLevel, BossLevel, BossLevel, BossLevel]
BossLevel,
BossLevel,
BossLevel,
BossLevel,
BossLevel,
BossLevel,
BossLevel
];
} }
export interface LastBossResult { export interface LastBossResult {
@ -61,14 +44,14 @@ export interface LastBossResult {
} }
export interface PlayerContextType { export interface PlayerContextType {
isRegistered: boolean; isRegistered: boolean,
player: null | Player; player: null | Player,
army: null | Army; army: null | Army,
boss: null | Boss; boss: null | Boss,
lastBossResult: null | LastBossResult; lastBossResult: null | LastBossResult,
balance: bigint; balance: bigint,
register: (arg: "ETH" | "RGCVII") => void; register: (arg: "ETH" | "RGCVII") => void,
raid: () => void; raid: () => void,
battleWithBoss: () => void; battleWithBoss: () => void;
addUnit: (unit: UnitType, amount?: number) => void; addUnit: (unit: UnitType, amount?: number) => void;
} }
@ -80,199 +63,169 @@ const PlayerContext = createContext<PlayerContextType>({
boss: null, boss: null,
lastBossResult: null, lastBossResult: null,
balance: BigInt(0), balance: BigInt(0),
register: () => {}, register: () => { },
raid: () => {}, raid: () => { },
battleWithBoss: () => {}, battleWithBoss: () => { },
addUnit: () => {}, addUnit: () => { }
}); });
const PlayerProvider = ({ children }: { children: ReactNode }) => { const PlayerProvider = ({ children }: { children: ReactNode }) => {
const { address, isConnected } = useAccount(); const { address, isConnected } = useAccount();
const { writeContract, error } = useWriteContract(); const { writeContract, error } = useWriteContract();
const [[txHash, callbackFn], setHashAndCallback] = useState< const [[txHash, callbackFn], setHashAndCallback] = useState<[Hash | null, () => void]>([null, () => { }])
[Hash | null, () => void]
>([null, () => {}]);
const [bossBattledModalOpen, setBossBattlesModalOpen] = useState(false); const [bossBattledModalOpen, setBossBattlesModalOpen] = useState(false);
const hasFetchedLastBossFirstTime = useRef(false); const hasFetchedLastBossFirstTime = useRef(false);
useEffect(() => { useEffect(() => {
console.warn(error); console.warn(error)
}, [error]); }, [error])
const resetHashAndCallback = useCallback(() => { const resetHashAndCallback = useCallback(() => {
setHashAndCallback([null, () => {}]); setHashAndCallback([null, () => { }])
}, []); }, [])
const { data: isRegistered } = useReadContract({ const { data: isRegistered } = useReadContract({
address: contractAddress, address: contractAddress,
abi, abi,
functionName: "isRegistered", functionName: 'isRegistered',
args: [address], args: [address],
query: { query: {
enabled: isConnected, enabled: isConnected,
refetchInterval: 10000, refetchInterval: 15,
}, }
}); });
const { data: balance } = useReadContract({ const { data: balance, } = useReadContract({
address: contractAddress, address: contractAddress,
abi, abi,
functionName: "balanceOf", functionName: 'balanceOf',
args: [address], args: [address],
query: { query: {
refetchInterval: 10000, refetchInterval: 15,
enabled: isConnected, enabled: isConnected
}, }
}); });
const { data: player } = useReadContract({ const { data: player } = useReadContract({
address: contractAddress, address: contractAddress,
abi, abi,
functionName: "getPlayer", functionName: 'getPlayer',
args: [address], args: [address],
query: { query: {
enabled: isConnected, enabled: isConnected,
refetchInterval: 10000, refetchInterval: 15
}, }
}); });
const { data: army } = useReadContract({ const { data: army } = useReadContract({
address: contractAddress, address: contractAddress,
abi, abi,
functionName: "getArmy", functionName: 'getArmy',
args: [address], args: [address],
query: { query: {
enabled: isConnected, enabled: isConnected,
refetchInterval: 10000, refetchInterval: 15
}, }
}); });
const { data: boss } = useReadContract({ const { data: boss } = useReadContract({
address: contractAddress, address: contractAddress,
abi, abi,
functionName: "getBoss", functionName: 'getBoss',
args: [address], args: [address],
query: { query: {
enabled: isConnected, enabled: isConnected,
refetchInterval: 10000, refetchInterval: 15
}, }
}); });
const { data: lastBossResult } = useReadContract({ const { data: lastBossResult } = useReadContract({
address: contractAddress, address: contractAddress,
abi, abi,
functionName: "getLastBossResult", functionName: 'getLastBossResult',
args: [address], args: [address],
query: { query: {
enabled: isConnected, enabled: isConnected,
refetchInterval: 10000, refetchInterval: 15
}, }
}); });
const register = useCallback( console.log(balance, player, army, boss)
(arg: "RGCVII" | "ETH") => {
if (arg === "ETH") { const register = useCallback((arg: "RGCVII" | "ETH") => {
writeContract( if (arg === 'ETH') {
{ writeContract({
abi, abi,
address: contractAddress, address: contractAddress,
functionName: "register_eth", functionName: 'register_eth',
value: parseEther("0.00045"), value: parseEther("0.00005"),
}, }, {
{ onSuccess: (hash) => {
onSuccess: (hash) => { setHashAndCallback([hash, resetHashAndCallback])
setHashAndCallback([hash, resetHashAndCallback]); },
}, onError: () => resetHashAndCallback()
onError: () => resetHashAndCallback(), })
} } else if (arg === "RGCVII") {
); writeContract({
} else if (arg === "RGCVII") { abi,
writeContract( address: daoTokenAddress,
{ functionName: 'approve',
abi, args: [contractAddress, parseEther("500")],
address: daoTokenAddress, }, {
functionName: "approve", onSuccess: (hash) => {
args: [contractAddress, parseEther("400")], setHashAndCallback([
}, hash,
{ () => writeContract({
onSuccess: (hash) => { abi,
setHashAndCallback([ address: contractAddress,
hash, functionName: 'register_dao',
() => }, {
writeContract( onSuccess: (hash) => {
{ setHashAndCallback([hash, resetHashAndCallback])
abi, },
address: contractAddress, onError: () => resetHashAndCallback()
functionName: "register_dao", })
}, ])
{ },
onSuccess: (hash) => { onError: () => resetHashAndCallback()
setHashAndCallback([hash, resetHashAndCallback]); });
}, }
onError: () => resetHashAndCallback(), }, [writeContract, resetHashAndCallback])
}
),
]);
},
onError: () => resetHashAndCallback(),
}
);
}
},
[writeContract, resetHashAndCallback]
);
const raid = useCallback(() => { const raid = useCallback(() => {
writeContract( writeContract({
{ abi,
abi, address: contractAddress,
address: contractAddress, functionName: 'raid',
functionName: "raid", }, {
onSuccess: (hash) => {
setHashAndCallback([hash, resetHashAndCallback])
}, },
{ onError: () => resetHashAndCallback()
onSuccess: (hash) => { })
setHashAndCallback([hash, resetHashAndCallback]); }, [writeContract, resetHashAndCallback])
},
onError: () => resetHashAndCallback(),
}
);
}, [writeContract, resetHashAndCallback]);
const addUnit = useCallback( const addUnit = useCallback((unit: UnitType) => {
(unit: UnitType) => { writeContract({
writeContract( abi,
{ address: contractAddress,
abi, functionName: 'addUnit',
address: contractAddress, args: [unit, 1]
functionName: "addUnit", })
args: [unit, 1], }, [writeContract])
},
{
onSuccess: () => {
coinSound();
},
onError: () => resetHashAndCallback(),
}
);
},
[writeContract, resetHashAndCallback]
);
const battleWithBoss = useCallback(() => { const battleWithBoss = useCallback(() => {
writeContract( writeContract({
{ abi,
abi, address: contractAddress,
address: contractAddress, functionName: 'battle_with_boss',
functionName: "battle_with_boss", }, {
onSuccess: (hash) => {
setHashAndCallback([hash, () => resetHashAndCallback()])
}, },
{ onError: () => resetHashAndCallback()
onSuccess: (hash) => { })
setHashAndCallback([hash, () => resetHashAndCallback()]); }, [writeContract, resetHashAndCallback])
},
onError: () => resetHashAndCallback(),
}
);
}, [writeContract, resetHashAndCallback]);
useEffect(() => { useEffect(() => {
if (lastBossResult != null) { if (lastBossResult != null) {
@ -282,40 +235,33 @@ const PlayerProvider = ({ children }: { children: ReactNode }) => {
hasFetchedLastBossFirstTime.current = true; hasFetchedLastBossFirstTime.current = true;
} }
} }
}, [lastBossResult]); }, [lastBossResult])
return ( return (
<PlayerContext.Provider <PlayerContext.Provider value={{
value={{ isRegistered: isRegistered as boolean,
isRegistered: isRegistered as boolean, player: player as Player,
player: player as Player, army: army as Army,
army: army as Army, boss: boss as Boss,
boss: boss as Boss, balance: balance as bigint,
balance: balance as bigint, lastBossResult: lastBossResult as LastBossResult,
lastBossResult: lastBossResult as LastBossResult, register,
register, raid,
raid, addUnit,
addUnit, battleWithBoss
battleWithBoss, }}>
}}
>
{children} {children}
<div <div className={`${(txHash || bossBattledModalOpen) ? styles.leaderboardOverlay : ""}`}>
className={`${
txHash || bossBattledModalOpen ? styles.leaderboardOverlay : ""
}`}
>
{txHash && <WaitingForTxModal hash={txHash} callbackFn={callbackFn} />} {txHash && <WaitingForTxModal hash={txHash} callbackFn={callbackFn} />}
{bossBattledModalOpen && ( {bossBattledModalOpen && <BossOutcomeModal setIsOpen={setBossBattlesModalOpen} />}
<BossOutcomeModal setIsOpen={setBossBattlesModalOpen} />
)}
</div> </div>
</PlayerContext.Provider> </PlayerContext.Provider>
); );
}; }
export const usePlayer = () => { export const usePlayer = () => {
return useContext(PlayerContext); return useContext(PlayerContext);
}; }
export default PlayerProvider
export default PlayerProvider;

View File

@ -154,8 +154,7 @@
filter: sepia(1); filter: sepia(1);
pointer-events: none; pointer-events: none;
} }
&:hover, &:hover {
&.isUnavailable {
.unitProfit { .unitProfit {
display: block; display: block;
} }
@ -311,6 +310,8 @@
} }
} }
@keyframes marchingPerson { @keyframes marchingPerson {
0% { 0% {
background-size: 100% 100%; background-size: 100% 100%;

View File

@ -402,8 +402,7 @@
} }
} }
.leaderboardButton, .leaderboardButton {
.metricsButton {
position: absolute; position: absolute;
top: 30px; top: 30px;
left: 80px; left: 80px;
@ -426,12 +425,6 @@
} }
} }
} }
.metricsButton {
left: auto;
top: auto;
right: 32px;
bottom: 32px;
}
.leaderboardButton:hover { .leaderboardButton:hover {
transform: scale(1.1); transform: scale(1.1);

View File

@ -1,29 +0,0 @@
.dashboard {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 2rem;
padding: 2rem;
max-width: 1200px;
margin: 0 auto;
}
.metric {
background: rgba(0, 0, 0, 0.8);
border-radius: 8px;
padding: 1.5rem;
text-align: center;
border: 1px solid rgba(255, 255, 255, 0.1);
}
.metric h3 {
color: #888;
margin: 0 0 1rem 0;
font-size: 1.1rem;
}
.metric p {
color: #fff;
font-size: 2rem;
margin: 0;
font-weight: bold;
}

View File

@ -16,7 +16,7 @@
align-items: center; align-items: center;
width: 100%; width: 100%;
max-width: 720px; max-width: 720px;
height: 960px; height: 100vh;
margin: 0 auto; margin: 0 auto;
@media only screen and (max-width: 600px) { @media only screen and (max-width: 600px) {
max-height: 90vh; max-height: 90vh;

View File

@ -29,16 +29,16 @@
color: #9b215e; color: #9b215e;
} }
& > .boss3 { & > .boss3 {
color: #c6282e; color: #ebb638;
} }
& > .boss4 { & > .boss4 {
color: #d06b53; color: #c6282e;
} }
& > .boss5 { & > .boss5 {
color: #8f968f; color: #d06b53;
} }
& > .boss6 { & > .boss6 {
color: #ebb638; color: #8f968f;
} }
} }
& small { & small {

View File

@ -1,23 +0,0 @@
.metricsPage {
min-height: 100vh;
padding: 2rem;
background: #1a1a1a;
color: white;
}
.metricsPage h1 {
text-align: center;
margin-bottom: 3rem;
}
.backLink {
display: inline-block;
color: #888;
text-decoration: none;
margin-bottom: 2rem;
transition: color 0.2s;
}
.backLink:hover {
color: white;
}

View File

@ -1,31 +1,25 @@
export interface Player { export interface Player {
id: string; id: string
totalMinted: string; totalMinted: string
currentBalance: string; currentBalance: string
numberOfRaids: string; numberOfRaids: string
army?: Army; army?: Army
bossesDefeated?: string; }
prestigeLevel: string;
} export interface Army {
player: Player
export interface Army { profitPerSecond: string
player: Player; projectedDailyEarnings: string
profitPerSecond: string; molochDenierLevel: string
projectedDailyEarnings: string; apprenticeLevel: string
molochDenierLevel: string; anointedLevel: string
apprenticeLevel: string; championLevel: string
anointedLevel: string; }
championLevel: string;
} export interface TopEarnersResponse {
armies: Army[]
export interface TopEarnersResponse { }
armies: Army[];
} export interface TopRaidersResponse {
players: Player[]
export interface TopRaidersResponse { }
players: Player[];
}
export interface PlayerResponse {
players: Player[];
}

View File

@ -1,44 +0,0 @@
// https://sfxr.me/
// https://github.com/chr15m/jsfxr?tab=readme-ov-file#library
// https://github.com/goldfire/howler.js
import { sfxr } from "jsfxr";
import { Howl } from "howler";
export const coinSound = () => {
const coin = sfxr.toAudio(
"34T6PkpUzHPSs4CvSaNXpQ6fftpW1yrCDSda6oECJ5CH6BEaokmoZC7aAra2xef61iP6srxUaRZUk8Z2DRJHNMEvtWCLjgKkUCFtpxPe9o8AvYBCJZG1YNNPR"
);
coin.play();
};
export const errorSound = () => {
const fail = sfxr.toAudio(
"3mLuemG9nym33ak7ot6gTcNTFBBnNkcF4rmQFkh1zRhrvJ6totmE1EX61m9LTW9KWGuQpQEMqnVopubShwmxqQK7vAZYMXKbJCxYE9bcTh2qMm9JbMRJAKD5a"
);
fail.play();
};
export const clickSound = () => {
const click = sfxr.toAudio(
"7BMHBGPkXasqBZ54qHeMQTKSwDs2Y176H4hQVNkvQPg5eZyckEhyzKTnAZfqnp9ayL5iPVRNXFNjXAXBbUKhT7U6c1hKZBgWzaWkWTQvmcrCwikKi3RoF7wbd"
);
click.play();
};
export const lostSound = () => {
const fail = new Howl({
src: ["/sounds/lost.wav"],
volume: 0.7
});
fail.play();
};
export const wonSound = () => {
const won = new Howl({
src: ["/sounds/arcade_win.wav"],
});
won.play();
};

View File

@ -9,9 +9,9 @@ export const config = getDefaultConfig({
appName: 'RainbowKit App', appName: 'RainbowKit App',
projectId: 'YOUR_PROJECT_ID', projectId: 'YOUR_PROJECT_ID',
chains: [ chains: [
base,
foundry,
baseSepolia, baseSepolia,
foundry,
base,
], ],
ssr: true, ssr: true,
}); });

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,8 +4,3 @@ out = "out"
libs = ["lib"] libs = ["lib"]
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
remappings = [
"@uniswap/v3-core/=lib/v3-core/",
"@uniswap/v3-periphery=lib/v3-periphery/",
]

View File

@ -1,11 +0,0 @@
MNEMONIC=
ACCOUNT_PK=
INFURA_API_KEY=
ETHERSCAN_API_KEY=
GNOSISSCAN_API_KEY=
POLYGONSCAN_API-KEY=
OPTIMISTICSCAN_API_KEY=
ARBISCAN_API_KEY=
BASESCAN_API_KEY=
REPORT_GAS=false
COINMARKETCAP_API_KEY=

View File

@ -1 +0,0 @@
*.sol linguist-language=Solidity

View File

@ -1,36 +0,0 @@
name: Publish
on:
push:
branches:
- feat/baalZodiac
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/
- run: yarn global add npm
- name: Check package version
id: cpv
uses: PostHog/check-package-version@v2
- name: Echo package vs published versions
run: |
echo "Committed version: ${{ steps.cpv.outputs.committed-version }}"
echo "Published version: ${{ steps.cpv.outputs.published-version }}"
echo "Is new version: ${{ steps.cpv.outputs.is-new-version }}"
- run: yarn install
if: steps.cpv.outputs.is-new-version == 'true'
- run: yarn build
if: steps.cpv.outputs.is-new-version == 'true'
- run: yarn test
if: steps.cpv.outputs.is-new-version == 'true'
- name: publishing
if: steps.cpv.outputs.is-new-version == 'true'
run: |
echo '//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}' > .npmrc
npm publish --access public --scope daohaus --otp ${{ secrets.NPM_TOKEN }}

20
lib/Baal/.gitignore vendored
View File

@ -1,20 +0,0 @@
node_modules/
artifacts/
cache/
.DS_Store
*.swp
*.txt
yarn-error.log
dist/
src/types/
abi/
export/
.openzeppelin/
.env
.env.production
.env.staging
coverage.json
coverage/

View File

@ -1,4 +0,0 @@
*
!dist/**
!package.json
!README.md

View File

@ -1,6 +0,0 @@
{
"solidity.defaultCompiler": "localNodeModule",
"solidity.compileUsingRemoteVersion": "v0.8.7+commit.e28d00a7",
"solidity.enableLocalNodeCompiler": false
}

View File

@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -1,248 +0,0 @@
# Baal 👺
Baal (Molochv3) is a minimal yet composable DAO template continuing work from the
Moloch, Minion, Compound/OZ and Safe frameworks to make it easier for people to
combine and command crypto assets with intuitive membership games.
*Guilds, venture clubs and control panels can benefit from Baal:*
<p align="center"><img src="https://media.giphy.com/media/rgwNTGFUbNTgsgiYha/giphy.gif"></p>
## Setup
If you are going to just use this project feel free to clone it. If you would like to submit any pull requests please create an issue or work on a current issue and fork the repo. The main groups that are contributing to this project are [Moloch Mystics](https://github.com/Moloch-Mystics/Baal), [DaoHaus](https://discord.com/channels/709210493549674598) [MetaCartel](https://discord.com/channels/702325961433284609).
### Setup Environment
`yarn install` - to install all of the components for the project
`.env.sample` containes the all required environment variables that need to be set to build, deploy & publish the smart contracts on the blockchain. These should be added to a `.env[.*]` file.
### Building
This project uses the [hardhat](https://hardhat.org/) ethereum tools for solidity compiling and running a virtual ethereum environment for testing.
`yarn build` - will compile the solidity code and generate your contract artifacts (in the /artifacts directory), and generate all of the necessary types.
### Testing
If you are looking to work on unit tests for this project be sure to read the README file in the test directory.
`yarn hardhat test` - run the unit tests
## Publishing
the Baal contracts, types, and abis are published through the CI process, after making changes to the repo, and when you are ready to publish the packages, do the following:
1) bump the version in `package.json`
2) push and merge into `feat/baalZodiac` branch
running the CI process will trigger on `merges to feat/baalZodiac branch` build the dist folder and publish it to `@daohaus/baal-contracts` package to npm if the package.json version is different than the current latest on npm.
----
## Folder Structure
- ./abi - generated abis
- ./contracts - main solidity contracts, interfaces, tools and utils
- ./deploy - deploy scripts and helpers)
- ./scripts - deploy scripts and helpers (**soon to be deprecated**)
- ./tasks - hard hat cli tasks
- ./tests - test files
----
## Coverage
currently, coverage is turned off for test efficiency purposes. In order to switch coverage on, add `yul` to the hardhat config:
```
{
...
compilers: [
{
version: "0.8.7",
settings: {
optimizer: {
enabled: true,
runs: 200,
details: {
yul: true
}
},
},
}
]
}
```
then run the coverage command:
```
npx hardhat coverage
```
----
## Verify Contracts
Run the following command:
```
yarn hardhat etherscan-verify
```
----
## Importing the package on your own project
You can `yarn add @daohaus/baal-contracts` on your own project and get access to Baal smart contracts, ABIs & deployment scripts for local testing your contract integrations:
* *Smart contracts*: you can import Baal smart contract on your Hardhat /Foundry / Truffle project at `@daohaus/baal-contracts/contracts/*`
* *ABIs*: if your custom frontend needs to interact with Baal contracts, you can find contract ABIs at `@daohaus/baal-contracts/abi/*`
* *Local testing*: if you're using [hardhat-deploy](https://www.npmjs.com/package/hardhat-deploy), you can reuse our scripts to deploy all Baal + infrastructure contracts locally to perform integration testing with your implementation. You just need to follow these steps:
1. Add these lines on your `hardhat.config.ts` config file to allow `hardhat-deploy` to find Baal artifacts & deployment scripts:
```
...
external: {
contracts: [
{
artifacts: 'node_modules/@daohaus/baal-contracts/export/artifacts',
deploy: 'node_modules/@daohaus/baal-contracts/export/deploy'
}
]
},
...
```
2. On your test scripts, you can call `await deployments.fixture([tag1, tag2, ...])` (e.g. under `beforeEach()`) and specify the deployment tags you need. For example, `await deployments.fixture(['Infra', 'BaalSummoner'])` will deploy both Safe & Baal contracts.
3. You can also use the [`baalSetup`](test/utils/fixtures.ts) fixture to setup your tests with factory contracts, baal settings, members, loot/shares/token distributions, etc. Moreover, you can also customize it to cover new use cases such as custom summoner contracts, shamans and other setup needs by implementing the`setupBaalOverride` and/or `setupUsersOverride` fixture function parameters. You can take a look at a few example implementations of ([baalSetup](test/utils/baal.ts) and [setupUsersDefault](test/utils/fixtures.ts)) for inspiration. You can find and import all the available scripts/fixtures available for hardhat testing as follows:
```js
import { baalSetup, ... } from "@daohaus/baal-contracts/hardhat";
```
Below, there's the list of parameters can be customized when calling the hardhat fixture:
```js
type BaalSetupOpts = {
fixtureTags?: Array<string>; // additional deployment tags
daoSettings?: Partial<DAOSettings>;
summonSetupOpts?: Partial<SummonSetup>;
safeAddress?: `0x${string}`;
forwarderAddress?: `0x${string}`;
lootAddress?: `0x${string}`;
sharesAddress?: `0x${string}`;
setupBaalOverride?: (params: NewBaalParams) => Promise<NewBaalAddresses>;
setupUsersOverride?: (params: SetupUsersParams) => Promise<UsersSetup>;
}
```
To learn more about using `fixtures` on hardhat visit [link1](https://github.com/wighawag/hardhat-deploy#creating-fixtures) and [link2](https://www.npmjs.com/package/hardhat-deploy#testing-deployed-contracts). It is also recommended to check out the [Baal shamans](https://github.com/HausDAO/baal-shamans) repository for examples.
----
## Contracts
### **Baal (contracts/Baal.sol)**
It is a minimal yet composable DAO template continuing work from
the Moloch, Minion and Compound frameworks to make it easier for
people to combine and command crypto assets with intuitive membership
games.
#### Interfaces
* EIP721
* OZ Minimal Clone Factoy [EIP 1167 Clones](https://docs.openzeppelin.com/contracts/4.x/api/proxy#Clones)
Gnosis Safe Module [Zodiac](https://github.com/gnosis/zodiac)
### **Shares (contracts/SharesERC20.sol)**
Have direct execution, voting, and exit rights around actions
taken by the main DAO contract. Shareholders are the collective DAO
admins.
#### Interfaces
* ERC20, Initializable [OpenZeplin v4](https://docs.openzeppelin.com/contracts/4.x/)
### **BaalVotes (contracts/utils/BaalVotes.sol)**
Abstract with a similar Implimentation of ERC20VOTES with the main
difference being auto self-delegation and the use of timestmap instead of block.number.
#### Interfaces
* ERC20Permit
### **Loot (contracts/LootERC20.sol)**
Has only exit rights against the DAO treasury, so loot does
not have the ability to admin the DAO config. However, because it has
exit rights, it is still a powerful unit, and because it is an ERC-20
can be used in many composable ways.
#### Interfaces
* ERC20, ERC20Snapshot, ERC20Permit, Initializable [OpenZeplin v4](https://docs.openzeppelin.com/contracts/4.x/)
### **TributeMinion (contracts/tools/TributeMinion.sol)**
It is a helper contract for making tribute proposals.
Provides contract to approve ERC-20 transfers. Provides a simple
function/interface to make a single proposal type.
### **BaalSummoner (contracts/BaalSummoner.sol)**
Factory to summon new dao contracts.
It can take an existing safe or exsiting tokens
### **Higher Order BaalAndVaultSummoner (contracts/higherOrderFactories/BaalAndVaultSummoner.sol)**
Factory to summon new dao contracts with an extra 'sidecar' non-ragequitable vault.
A registry is used to save safe addresses for use in UI.
It can also add a external safe to an existing DAO as owner
### **Higher Order BaalAdvTokenSummoner (contracts/higherOrderFactories/BaalAdvTokenSummoner.sol)**
Factory to summon new dao contracts with custom loot token name and symbol
Minting and pausing of token happen upfront before Baal is setup
----
## Privileged roles
- Shamans - are specific addresses that have more granular control
outside the standard governance proposal flow. These addresses should
always be contracts that have been explicitly given these rights
through the standard proposal flow or during initial DAO setup.
- Governor - can cancel a proposal, set Governance Config (change the
length of proposals, if there is a required quorum, etc.).
- Manager - can mint/burn shares/loot.
- Admin - can set Admin configuration and pause/unpause shares/loot.
- DAO - is always a super admin over its config and can vote to make
changes to its configuration at any time.
## Risks
- In case of Shaman keys leak, an attacker can get access to Baal
(admin) functionalities, burn, mint, give shaman roles etc.
Because of this Shamans are ment to be external contracts and not EOAs
but it is up to the DAO to enforce this.
## More Documentation
More docs for [Functions](https://baal-docs.vercel.app/functions) and [Events](https://baal-docs.vercel.app/events), [V3 updates](https://baal-docs.vercel.app/features/updates), patterns, stories and other superficial musings can be found at the [Docs Page here](https://baal-docs.vercel.app/)
<p align="center"><img src="https://media.giphy.com/media/rgwNTGFUbNTgsgiYha/giphy.gif"></p>
## initial audit
See audit notes in ./audits
## Addresses Beta Factories and Templates
Would you like to deploy to another chain? Use scripts/deployFactories and scripts/deployTribute. Please reach out for more info on deploys
see current deploys at: src/addresses/deployed.js
## License
[MIT]()

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,351 +0,0 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol";
import "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol";
import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "./Baal.sol";
contract BaalSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable {
// when some of the init addresses are updated
uint256 public addrsVersion;
address payable public template; // fixed template for baal using eip-1167 proxy pattern
// Template contract to use for new Gnosis safe proxies
address public gnosisSingleton;
// Library to use for EIP1271 compatability
address public gnosisFallbackLibrary;
// Library to use for all safe transaction executions
address public gnosisMultisendLibrary;
// template contract to clone for loot ERC20 token
address public lootSingleton;
// template contract to clone for shares ERC20 token
address public sharesSingleton;
// Proxy summoners
//
GnosisSafeProxyFactory gnosisSafeProxyFactory;
ModuleProxyFactory moduleProxyFactory;
event SetAddrsVersion(
uint256 version
);
event SummonBaal(
address indexed baal,
address indexed loot,
address indexed shares,
address safe,
address forwarder,
uint256 existingAddrs
);
event DaoReferral(
bytes32 referrer,
address daoAddress
);
event DeployBaalTokens(
address lootToken,
address sharesToken
);
event DeployBaalSafe(
address baalSafe,
address moduleAddr
);
function initialize() initializer public {
__Ownable_init();
__UUPSUpgradeable_init();
}
// must be called after deploy to set libraries
function setAddrs(
address payable _template,
address _gnosisSingleton,
address _gnosisFallbackLibrary,
address _gnosisMultisendLibrary,
address _gnosisSafeProxyFactory,
address _moduleProxyFactory,
address _lootSingleton,
address _sharesSingleton
) public onlyOwner {
require(_lootSingleton != address(0), "!lootSingleton");
require(_sharesSingleton != address(0), "!sharesSingleton");
require(_gnosisSingleton != address(0), "!gnosisSingleton");
require(_gnosisFallbackLibrary != address(0), '!gnosisFallbackLibrary');
require(_gnosisMultisendLibrary != address(0), '!gnosisMultisendLibrary');
require(_gnosisSafeProxyFactory != address(0), '!gnosisSafeProxyFactory');
require(_moduleProxyFactory != address(0), '!moduleProxyFactory');
template = _template;
gnosisSingleton = _gnosisSingleton;
gnosisFallbackLibrary = _gnosisFallbackLibrary;
gnosisMultisendLibrary = _gnosisMultisendLibrary;
gnosisSafeProxyFactory = GnosisSafeProxyFactory(_gnosisSafeProxyFactory);
moduleProxyFactory = ModuleProxyFactory(_moduleProxyFactory);
lootSingleton = _lootSingleton;
sharesSingleton = _sharesSingleton;
emit SetAddrsVersion(
addrsVersion++
);
}
function encodeMultisend(bytes[] memory _calls, address _target)
public
pure
returns (bytes memory encodedMultisend)
{
bytes memory encodedActions;
for (uint256 i = 0; i < _calls.length; i++) {
encodedActions = abi.encodePacked(
encodedActions,
uint8(0),
_target,
uint256(0),
uint256(_calls[i].length),
bytes(_calls[i])
);
}
encodedMultisend = abi.encodeWithSignature(
"multiSend(bytes)",
encodedActions
);
}
function summonBaal(
bytes calldata initializationParams,
bytes[] calldata initializationActions,
uint256 _saltNonce
) external returns (address) {
return
_summonBaal(
initializationParams,
initializationActions,
_saltNonce
);
}
// Add a referrer to help keep track of where deploies are coming from
function summonBaalFromReferrer(
bytes calldata initializationParams,
bytes[] calldata initializationActions,
uint256 _saltNonce,
bytes32 referrer
) external payable returns (address) {
address daoAddress;
daoAddress = _summonBaal(
initializationParams,
initializationActions,
_saltNonce
);
emit DaoReferral(referrer, daoAddress);
return daoAddress;
}
// deploy new share and loot contracts
function deployTokens(string memory _name, string memory _symbol)
public
returns (address lootToken, address sharesToken)
{
lootToken = address(new ERC1967Proxy(
lootSingleton,
abi.encodeWithSelector(
IBaalToken(lootSingleton).setUp.selector,
string(abi.encodePacked(_name, " LOOT")),
string(abi.encodePacked(_symbol, "-LOOT")))
));
sharesToken = address(new ERC1967Proxy(
sharesSingleton,
abi.encodeWithSelector(
IBaalToken(sharesSingleton).setUp.selector,
_name,
_symbol)
));
emit DeployBaalTokens(lootToken, sharesToken);
}
function configureSafe(address _moduleAddr, GnosisSafe _safe) internal {
// Generate delegate calls so the safe calls enableModule on itself during setup
bytes memory _enableBaal = abi.encodeWithSignature(
"enableModule(address)",
address(_moduleAddr)
);
bytes memory _enableBaalMultisend = abi.encodePacked(
uint8(0),
address(_safe),
uint256(0),
uint256(_enableBaal.length),
bytes(_enableBaal)
);
bytes memory _multisendAction = abi.encodeWithSignature(
"multiSend(bytes)",
_enableBaalMultisend
);
// Workaround for solidity dynamic memory array
address[] memory _owners = new address[](1);
_owners[0] = address(_moduleAddr);
// Call setup on safe to enable our new module and set the module as the only signer
_safe.setup(
_owners,
1,
gnosisMultisendLibrary,
_multisendAction,
gnosisFallbackLibrary,
address(0),
0,
payable(address(0))
);
}
// deploy a safe with module and single module signer setup
// with nounce
function deployAndSetupSafe(address _moduleAddr, uint256 _saltNonce)
public
returns (address)
{
GnosisSafe _safe = GnosisSafe(
payable(
gnosisSafeProxyFactory.createProxyWithNonce(
gnosisSingleton,
bytes(""),
_saltNonce
)
)
);
configureSafe(_moduleAddr, _safe);
emit DeployBaalSafe(address(_safe), address(_moduleAddr));
return address(_safe);
}
// deploy a safe with module and single module signer setup
function deployAndSetupSafe(address _moduleAddr)
public
returns (address)
{
GnosisSafe _safe = GnosisSafe(
payable(
gnosisSafeProxyFactory.createProxy(
gnosisSingleton,
bytes("")
)
)
);
configureSafe(_moduleAddr, _safe);
emit DeployBaalSafe(address(_safe), address(_moduleAddr));
return address(_safe);
}
// advanced summon baal with different configurations
// name and symbol can be blank if bringing own baal tokens
// zero address for either loot or shares token will summon new ones
// if bringing own tokens the ownership must be transfered to the new DAO
// zero address for Safe with summon and setup a new Safe
// if bringing existing safe the new dao must be enabled as a module
// todo: add a simple summon that just creates a dao with a single summoner
function _summonBaal(
bytes calldata initializationParams,
bytes[] calldata initializationActions,
uint256 _saltNonce
) internal returns (address) {
uint256 existingAddrs; // 1 tokens, 2 safe, 3 both
(
string memory _name, /*_name Name for erc20 `shares` accounting, empty if token */
string memory _symbol, /*_symbol Symbol for erc20 `shares` accounting, empty if token*/
address _safeAddr, /*address of safe, 0 addr if new*/
address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771), 0 addr if initially disabled*/
address _lootToken, /*predeployed loot token, 0 addr if new*/
address _sharesToken /*predeployed shares token, 0 addr if new*/
) = abi.decode(initializationParams, (string, string, address, address, address, address));
Baal _baal = Baal(
moduleProxyFactory.deployModule(
template,
abi.encodeWithSignature("avatar()"),
_saltNonce
)
);
// if loot or shares are zero address new tokens are deployed
// tokens need to be baalTokens
if(_lootToken == address(0) || _sharesToken == address(0)){
(_lootToken, _sharesToken) = deployTokens(_name, _symbol);
// pause tokens by default and transfer to the DAO
IBaalToken(_lootToken).pause();
IBaalToken(_sharesToken).pause();
IBaalToken(_lootToken).transferOwnership(address(_baal));
IBaalToken(_sharesToken).transferOwnership(address(_baal));
} else {
existingAddrs += 1;
}
// if zero address deploy a new safe
// Needs to be a valid zodiac treasury
if(_safeAddr == address(0)){
_safeAddr = deployAndSetupSafe(address(_baal), _saltNonce);
} else {
existingAddrs += 2;
}
bytes memory _initializationMultisendData = encodeMultisend(
initializationActions,
address(_baal)
);
bytes memory _initializer = abi.encode(
_lootToken,
_sharesToken,
gnosisMultisendLibrary,
_safeAddr,
_forwarder,
_initializationMultisendData
);
// can run the actions now because we have a baal
_baal.setUp(_initializer);
emit SummonBaal(
address(_baal),
address(_baal.lootToken()),
address(_baal.sharesToken()),
_safeAddr,
_forwarder,
existingAddrs
);
return (address(_baal));
}
function _authorizeUpgrade(address newImplementation)
internal
onlyOwner
override
{}
}

View File

@ -1,98 +0,0 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
contract Loot is
ERC20SnapshotUpgradeable,
ERC20PermitUpgradeable,
PausableUpgradeable,
OwnableUpgradeable,
UUPSUpgradeable
{
constructor() {
_disableInitializers();
}
/// @notice Configure loot - called by Baal on summon
/// @dev initializer should prevent this from being called again
/// @param name_ Name for ERC20 token trackers
/// @param symbol_ Symbol for ERC20 token trackers
function setUp(string memory name_, string memory symbol_)
external
initializer
{
require(bytes(name_).length != 0, "loot: name empty");
require(bytes(symbol_).length != 0, "loot: symbol empty");
__ERC20_init(name_, symbol_);
__ERC20Permit_init(name_);
__Pausable_init();
__ERC20Snapshot_init();
__Ownable_init();
__UUPSUpgradeable_init();
}
/// @notice Allows baal to create a snapshot
function snapshot() external onlyOwner returns(uint256) {
return _snapshot();
}
/// @notice get current SnapshotId
function getCurrentSnapshotId() external view returns (uint256) {
return _getCurrentSnapshotId();
}
/// @notice Baal-only function to pause shares.
function pause() public onlyOwner {
_pause();
}
/// @notice Baal-only function to pause shares.
function unpause() public onlyOwner {
_unpause();
}
/// @notice Baal-only function to mint loot.
/// @param recipient Address to receive loot
/// @param amount Amount to mint
function mint(address recipient, uint256 amount) external onlyOwner {
// can not be more than half the max because of totalsupply of loot and shares
require(totalSupply() + amount <= type(uint256).max / 2, "loot: cap exceeded");
_mint(recipient, amount);
}
/// @notice Baal-only function to burn loot.
/// @param account Address to lose loot
/// @param amount Amount to burn
function burn(address account, uint256 amount) external onlyOwner {
_burn(account, amount);
}
/// @notice Internal hook to restrict token transfers unless allowed by baal
/// @dev Allows transfers if msg.sender is Baal which enables minting and burning
/// @param from The address of the source account.
/// @param to The address of the destination account.
/// @param amount The number of `loot` tokens to transfer.
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal override(ERC20Upgradeable, ERC20SnapshotUpgradeable) {
super._beforeTokenTransfer(from, to, amount);
require(
from == address(0) || /*Minting allowed*/
(msg.sender == owner() && to == address(0)) || /*Burning by Baal allowed*/
!paused(),
"loot: !transferable"
);
}
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
}

View File

@ -1,102 +0,0 @@
pragma solidity 0.8.7;
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol";
import "./utils/BaalVotes.sol";
import "./interfaces/IBaal.sol";
// import "hardhat/console.sol";
/// @title Shares
/// @notice Accounting for Baal non voting shares
contract Shares is BaalVotes, ERC20SnapshotUpgradeable, OwnableUpgradeable, PausableUpgradeable, UUPSUpgradeable {
constructor() {
_disableInitializers();
}
/// @notice Configure shares - called by Baal on summon
/// @dev initializer should prevent this from being called again
/// @param name_ Name for ERC20 token trackers
/// @param symbol_ Symbol for ERC20 token trackers
function setUp(string memory name_, string memory symbol_)
external
initializer
{
require(bytes(name_).length != 0, "shares: name empty");
require(bytes(symbol_).length != 0, "shares: symbol empty");
__ERC20_init(name_, symbol_);
__ERC20Permit_init(name_);
__Pausable_init();
__ERC20Snapshot_init();
__Ownable_init();
__UUPSUpgradeable_init();
__EIP712_init_delegation("delegation", "4");
}
/// @notice Baal-only function to pause shares.
function pause() public onlyOwner {
_pause();
}
/// @notice Baal-only function to unpause shares.
function unpause() public onlyOwner {
_unpause();
}
/// @notice Allows baal to create a snapshot
function snapshot() external onlyOwner returns(uint256) {
return _snapshot();
}
/// @notice get current SnapshotId
function getCurrentSnapshotId() external view returns (uint256) {
return _getCurrentSnapshotId();
}
/// @notice Baal-only function to mint shares.
/// @param recipient Address to receive shares
/// @param amount Amount to mint
function mint(address recipient, uint256 amount) external onlyOwner {
// can not be more than half the max because of totalsupply of loot and shares
require(totalSupply() + amount <= type(uint256).max / 2, "shares: cap exceeded");
_mint(recipient, amount);
}
/// @notice Baal-only function to burn shares.
/// @param account Address to lose shares
/// @param amount Amount to burn
function burn(address account, uint256 amount) external onlyOwner {
_burn(account, amount);
}
/// @notice Internal hook to restrict token transfers unless allowed by baal
/// @dev Allows transfers if msg.sender is Baal which enables minting and burning
/// @param from The address of the source account.
/// @param to The address of the destination account.
/// @param amount The number of `shares` tokens to transfer.
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal override(BaalVotes, ERC20SnapshotUpgradeable) {
super._beforeTokenTransfer(from, to, amount);
require(
from == address(0) || /*Minting allowed*/
(msg.sender == owner() && to == address(0)) || /*Burning by Baal allowed*/
!paused(),
"shares: !transferable"
);
}
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
}

View File

@ -1,8 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity 0.8.7;
import "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
import "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
import "@gnosis.pm/safe-contracts/contracts/libraries/MultiSend.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
import "@gnosis.pm/safe-contracts/contracts/examples/libraries/SignMessage.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
import "@gnosis.pm/safe-contracts/contracts/handler/CompatibilityFallbackHandler.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol

View File

@ -1,188 +0,0 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol";
import "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol";
import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "../Baal.sol";
import "../interfaces/IBaalSummoner.sol";
contract BaalAdvTokenSummoner is
Initializable,
OwnableUpgradeable,
UUPSUpgradeable
{
IBaalSummoner public _baalSummoner;
event setSummoner(address summoner);
event DeployBaalTokens(address lootToken, address sharesToken);
constructor() {
_disableInitializers();
}
function initialize() public initializer {
__Ownable_init();
__UUPSUpgradeable_init();
}
/**
* @dev Sets the address of the BaalSummoner contract
* @param baalSummoner The address of the BaalSummoner contract
*/
function setSummonerAddr(address baalSummoner) public onlyOwner {
require(baalSummoner != address(0), "zero address");
_baalSummoner = IBaalSummoner(baalSummoner);
emit setSummoner(baalSummoner);
}
/**
* @dev Summon a new Baal contract with a new set of tokens
* @param _safeAddr The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe
* @param _forwarderAddr The address of the forwarder to be used, 0x0 if not set
* @param _saltNonce The salt nonce to be used for the Safe contract
* @param initializationMintParams The parameters for minting the tokens
* @param initializationTokenParams The parameters for deploying the tokens
* @param postInitializationActions The actions to be performed after the initialization
*/
function summonBaalFromReferrer(
address _safeAddr,
address _forwarderAddr,
uint256 _saltNonce,
bytes calldata initializationMintParams,
bytes calldata initializationTokenParams,
bytes[] calldata postInitializationActions
) external {
// summon tokens
(address _lootToken, address _sharesToken) = deployTokens(
initializationTokenParams
);
// mint shares loot tokens
mintTokens(initializationMintParams, _lootToken, _sharesToken);
// summon baal with new tokens
address _baal = _baalSummoner.summonBaalFromReferrer(
abi.encode(
IBaalToken(_sharesToken).name(),
IBaalToken(_sharesToken).symbol(),
_safeAddr,
_forwarderAddr,
_lootToken,
_sharesToken
),
postInitializationActions,
_saltNonce,
bytes32(bytes("DHAdvTokenSummoner")) // referrer
);
// change token ownership to baal
IBaalToken(_lootToken).transferOwnership(address(_baal));
IBaalToken(_sharesToken).transferOwnership(address(_baal));
}
/**
* @dev mintTokens
* @param initializationTokens The parameters for minting the tokens
* @param _lootToken The loot token address
* @param _sharesToken The shares token address
*/
function mintTokens(
bytes calldata initializationTokens,
address _lootToken,
address _sharesToken
) internal {
(
address[] memory summoners, // The address to mint initial tokens to
uint256[] memory summonerShares, // The amount of shares to mint
uint256[] memory summonerLoot // The amount of loot to mint
) = abi.decode(initializationTokens, (address[], uint256[], uint256[]));
require(
summoners.length == summonerShares.length &&
summoners.length == summonerLoot.length,
"!array parity"
); /*check array lengths match*/
for (uint256 i = 0; i < summoners.length; i++) {
if (summonerLoot[i] > 0) {
IBaalToken(_lootToken).mint(
summoners[i],
summonerLoot[i]
); /*grant `to` `amount` `loot`*/
}
if (summonerShares[i] > 0) {
IBaalToken(_sharesToken).mint(
summoners[i],
summonerShares[i]
); /*grant `to` `amount` `shares`*/
}
}
}
/**
* @dev deployTokens
* @param initializationParams The parameters for deploying the tokens
*/
function deployTokens(
bytes calldata initializationParams
) internal returns (address lootToken, address sharesToken) {
(
string
memory _name /*_name Name for erc20 `shares` accounting, empty if token */,
string
memory _symbol /*_symbol Symbol for erc20 `shares` accounting, empty if token*/,
string
memory _lootName /* name for erc20 `loot` accounting, empty if token */,
string
memory _lootSymbol /* symbol for erc20 `loot` accounting, empty if token*/,
bool _transferableShares /* if shares is transferable */,
bool _transferableLoot /* if loot is transferable */
) = abi.decode(
initializationParams,
(string, string, string, string, bool, bool)
);
address lootSingleton = _baalSummoner.lootSingleton();
address sharesSingleton = _baalSummoner.sharesSingleton();
lootToken = address(
new ERC1967Proxy(
lootSingleton,
abi.encodeWithSelector(
IBaalToken(lootSingleton).setUp.selector,
_lootName,
_lootSymbol
)
)
);
sharesToken = address(
new ERC1967Proxy(
sharesSingleton,
abi.encodeWithSelector(
IBaalToken(sharesSingleton).setUp.selector,
_name,
_symbol
)
)
);
if (!_transferableShares) {
IBaalToken(sharesToken).pause();
}
if (!_transferableLoot) {
IBaalToken(lootToken).pause();
}
emit DeployBaalTokens(lootToken, sharesToken);
}
function _authorizeUpgrade(
address newImplementation
) internal override onlyOwner {}
}

View File

@ -1,160 +0,0 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "../interfaces/IBaalSummoner.sol";
/*
Summon new 'non-ragequitable' treasury Safe (Vaults). (sidecar?)
Can summon a dao with a new Vault.
Can summon a new vault for a dao after initial dao setup.
Acts as a register and the owner of the contract or DAO can deactivate
register is primarily a helper for UIs
Owner of the contract can add new vaults, and set current vaults
Contract is upgradable and should be owned by a DAO
*/
contract BaalAndVaultSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable {
IBaalSummoner public _baalSummoner;
uint256 public vaultIdx;
struct Vault{
uint256 id;
bool active;
address daoAddress;
address vaultAddress;
string name;
}
mapping(uint256 => Vault) public vaults;
mapping(address => address) public delegates;
event SetVault(
Vault vault
);
event SetDelegate(
address daoAddress,
address delegate
);
event setSummoner(
address summoner
);
function initialize() initializer public {
__Ownable_init();
__UUPSUpgradeable_init();
vaultIdx = 0;
}
function setSummonerAddr(
address baalSummoner
) public onlyOwner {
require(baalSummoner != address(0), "zero address");
_baalSummoner = IBaalSummoner(baalSummoner);
emit setSummoner(baalSummoner);
}
/** Summon a new baal and add a Vault */
function summonBaalAndVault(
bytes calldata initializationParams,
bytes[] calldata initializationActions,
uint256 saltNonce,
bytes32 referrer,
string memory name
) external returns (address _daoAddress, address _vaultAddress) {
_daoAddress = _baalSummoner.summonBaalFromReferrer(
initializationParams,
initializationActions,
saltNonce,
referrer
);
_vaultAddress = summonVault(_daoAddress, name);
}
/** create and add a Vault(Safe) to an existing DAO */
function summonVault(
address daoAddress,
string memory name
) public returns (address _vaultAddress) {
_vaultAddress = _baalSummoner.deployAndSetupSafe(
daoAddress
);
_setNewVault(name, daoAddress, _vaultAddress);
}
/** set a Vault as active or not on existing dao (owner only) */
// Admin functions to help maintain the registry.
function setVault(
uint256 id,
bool active
) public onlyOwner
{
_setVault(id, active);
}
/** set a new Vault as active on existing dao (owner only) */
// Admin functions to help maintain the registry.
function setNewVault(
address daoAddress,
address vaultAddress,
string memory name
) public onlyOwner
{
_setNewVault(name, daoAddress, vaultAddress);
}
/**
A DAO can set a Vault as inactive
*/
function deactivateVaultAsDao(
uint256 id,
address daoAddress
) external
{
require(msg.sender == daoAddress || msg.sender == delegates[daoAddress], "not DAO or delegate");
require(vaults[id].daoAddress == daoAddress && vaults[id].active,"!not active DAO vault");
_setVault(id, false);
}
/** Allow a Dao to set a delegate that can manage vault enteries */
function setDelegate(
address daoAddress,
address delegate
) external
{
require(msg.sender == daoAddress, "!DAO");
delegates[daoAddress] = delegate;
emit SetDelegate(daoAddress, delegate);
}
function _setVault(
uint256 id,
bool active
) internal
{
vaults[id].active = active;
emit SetVault(vaults[id]);
}
function _setNewVault(
string memory name,
address daoAddress,
address vaultAddress
) internal
{
vaultIdx += 1;
vaults[vaultIdx] = Vault(vaultIdx, true, daoAddress, vaultAddress, name);
emit SetVault(vaults[vaultIdx]);
}
function _authorizeUpgrade(address newImplementation)
internal
onlyOwner
override
{}
}

View File

@ -1,9 +0,0 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
interface IAdminShaman {
function isAdmin(address shaman) external view returns (bool);
// Admin Only
function setAdminConfig(bool pauseShares, bool pauseLoot) external;
}

View File

@ -1,112 +0,0 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
interface IBaal {
// DATA STRUCTURES
struct Proposal {
/*Baal proposal details*/
uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/
uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */
uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/
uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/
uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/
uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */
uint256 baalGas; /* gas needed to process proposal */
uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/
uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/
uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/
uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/
bool[4] status; /* [cancelled, processed, passed, actionFailed] */
address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */
bytes32 proposalDataHash; /*hash of raw data associated with state updates*/
}
/* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed
\-> Cancelled \-> Defeated */
enum ProposalState {
Unborn, /* 0 - can submit */
Submitted, /* 1 - can sponsor -> voting */
Voting, /* 2 - can be cancelled, otherwise proceeds to grace */
Cancelled, /* 3 - terminal state, counts as processed */
Grace, /* 4 - proceeds to ready/defeated */
Ready, /* 5 - can be processed */
Processed, /* 6 - terminal state */
Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */
}
function lootToken() external view returns (address);
function sharesToken() external view returns (address);
function votingPeriod() external view returns (uint32);
function gracePeriod() external view returns (uint32);
function proposalCount() external view returns (uint32);
function proposalOffering() external view returns (uint256);
function quorumPercent() external view returns (uint256);
function sponsorThreshold() external view returns (uint256);
function minRetentionPercent() external view returns (uint256);
function latestSponsoredProposalId() external view returns (uint32);
function state(uint32 id) external view returns (ProposalState);
function proposals(uint32 id) external view returns (Proposal memory);
function setUp(bytes memory initializationParams) external;
function multisendLibrary() external view returns (address);
// Module
function avatar() external view returns (address);
function target() external view returns (address);
function setAvatar(address avatar) external;
function setTarget(address avatar) external;
// BaseRelayRecipient
function trustedForwarder() external view returns (address);
function setTrustedForwarder(address trustedForwarderAddress) external;
function mintLoot(address[] calldata to, uint256[] calldata amount) external;
function burnLoot(address[] calldata from, uint256[] calldata amount) external;
function mintShares(address[] calldata to, uint256[] calldata amount) external;
function burnShares(address[] calldata from, uint256[] calldata amount) external;
function totalLoot() external view returns (uint256);
function totalShares() external view returns (uint256);
function totalSupply() external view returns (uint256);
function lootPaused() external view returns (bool);
function sharesPaused() external view returns (bool);
function shamans(address shaman) external view returns (uint256);
function setShamans(address[] calldata shamans, uint256[] calldata permissions) external;
function isAdmin(address shaman) external view returns (bool);
function isManager(address shaman) external view returns (bool);
function isGovernor(address shaman) external view returns (bool);
function lockAdmin() external;
function lockManager() external;
function lockGovernor() external;
function adminLock() external view returns (bool);
function managerLock() external view returns (bool);
function governorLock() external view returns (bool);
function setAdminConfig(bool pauseShares, bool pauseLoot) external;
function setGovernanceConfig(bytes memory governanceConfig) external;
function submitProposal(
bytes calldata proposalData,
uint32 expiration,
uint256 baalGas,
string calldata details
) external payable returns (uint256);
function sponsorProposal(uint32 id) external;
function processProposal(uint32 id, bytes calldata proposalData) external;
function cancelProposal(uint32 id) external;
function getProposalStatus(uint32 id) external returns (bool[4] memory);
function submitVote(uint32 id, bool approved) external;
function submitVoteWithSig(
address voter,
uint256 expiry,
uint256 nonce,
uint32 id,
bool approved,
uint8 v,
bytes32 r,
bytes32 s
) external;
function executeAsBaal(address to, uint256 value, bytes calldata data) external;
function ragequit(address to, uint256 sharesToBurn, uint256 lootToBurn, address[] calldata tokens) external;
function hashOperation(bytes memory transactions) external pure returns (bytes32);
function encodeMultisend(bytes[] memory calls, address target) external pure returns (bytes memory);
}

View File

@ -1,14 +0,0 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
interface IBaalAndVaultSummoner {
function _baalSummoner() external view returns (address);
function summonBaalAndVault(
bytes calldata initializationParams,
bytes[] calldata initializationActions,
uint256 saltNonce,
bytes32 referrer,
string memory name
) external returns (address _daoAddress, address _vaultAddress);
}

View File

@ -1,69 +0,0 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
interface IBaalSummoner {
event AdminChanged(address previousAdmin, address newAdmin);
event BeaconUpgraded(address indexed beacon);
event DaoReferral(bytes32 referrer, address daoAddress);
event DeployBaalSafe(address baalSafe, address moduleAddr);
event DeployBaalTokens(address lootToken, address sharesToken);
event Initialized(uint8 version);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event SetAddrsVersion(uint256 version);
event SummonBaal(
address indexed baal,
address indexed loot,
address indexed shares,
address safe,
address forwarder,
uint256 existingAddrs
);
event Upgraded(address indexed implementation);
function setAddrs(
address _template,
address _gnosisSingleton,
address _gnosisFallbackLibrary,
address _gnosisMultisendLibrary,
address _gnosisSafeProxyFactory,
address _moduleProxyFactory,
address _lootSingleton,
address _sharesSingleton
) external;
function initialize() external;
function transferOwnership(address newOwner) external;
function upgradeTo(address newImplementation) external;
function upgradeToAndCall(address newImplementation, bytes memory data) external payable;
function renounceOwnership() external;
function summonBaal(bytes memory initializationParams, bytes[] memory initializationActions, uint256 _saltNonce)
external
returns (address);
function summonBaalFromReferrer(
bytes memory initializationParams,
bytes[] memory initializationActions,
uint256 _saltNonce,
bytes32 referrer
) external payable returns (address);
function deployAndSetupSafe(address _moduleAddr) external returns (address);
function deployTokens(string memory _name, string memory _symbol)
external
returns (address lootToken, address sharesToken);
function encodeMultisend(bytes[] memory _calls, address _target)
external
pure
returns (bytes memory encodedMultisend);
function addrsVersion() external view returns (uint256);
function gnosisFallbackLibrary() external view returns (address);
function gnosisMultisendLibrary() external view returns (address);
function gnosisSingleton() external view returns (address);
function lootSingleton() external view returns (address);
function sharesSingleton() external view returns (address);
function owner() external view returns (address);
function proxiableUUID() external view returns (bytes32);
function template() external view returns (address);
}

View File

@ -1,68 +0,0 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
interface IBaalToken {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function setUp(string memory _name, string memory _symbol) external;
function mint(address recipient, uint256 amount) external;
function burn(address account, uint256 amount) external;
function pause() external;
function unpause() external;
function paused() external view returns (bool);
function transferOwnership(address newOwner) external;
function owner() external view returns (address);
function balanceOf(address account) external view returns (uint256);
function totalSupply() external view returns (uint256);
function snapshot() external returns(uint256);
function getCurrentSnapshotId() external returns(uint256);
function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);
function totalSupplyAt(uint256 snapshotId) external view returns (uint256);
// below is shares token specific
struct Checkpoint {
uint32 fromTimePoint;
uint256 votes;
}
function getPastVotes(address account, uint256 timePoint) external view returns (uint256);
function numCheckpoints(address) external view returns (uint256);
function getCheckpoint(address, uint256)
external
view
returns (Checkpoint memory);
function getVotes(address account) external view returns (uint256);
function delegates(address account) external view returns (address);
function delegationNonces(address account) external view returns (uint256);
function delegate(address delegatee) external;
function delegateBySig(
address delegatee,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) external;
}

View File

@ -1,8 +0,0 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
interface IGovernorShaman {
function isGovernor(address shaman) external view returns (bool);
// Governor Only
function setGovernanceConfig(bytes memory _governanceConfig) external;
}

View File

@ -1,15 +0,0 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
interface IManagerShaman {
function isManager(address shaman) external view returns (bool);
// Manager Only
function mintShares(address[] calldata to, uint256[] calldata amount) external;
function burnShares(address[] calldata from, uint256[] calldata amount) external;
function mintLoot(address[] calldata to, uint256[] calldata amount) external;
function burnLoot(address[] calldata from, uint256[] calldata amount) external;
}

View File

@ -1,6 +0,0 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
interface IPoster {
function post(string calldata content, string calldata tag) external;
}

View File

@ -1,70 +0,0 @@
pragma solidity 0.8.7;
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "../utils/BaalVotes.sol";
import "../interfaces/IBaal.sol";
// import "hardhat/console.sol";
/// @title Shares
/// @notice Accounting for Baal non voting shares
contract BaalLessShares is BaalVotes, OwnableUpgradeable, UUPSUpgradeable {
// Baal Config
IBaal public baal;
uint8 public version;
constructor() {
_disableInitializers();
}
/// @notice Configure shares - called by Baal on summon
/// @param _version new version
function setUp(uint8 _version)
external
reinitializer(_version)
{
baal = IBaal(address(0)); /*Configure Baal to setup sender*/
version = _version;
__Ownable_init();
__UUPSUpgradeable_init();
}
/// @notice owner-only function to mint shares.
/// @param recipient Address to receive shares
/// @param amount Amount to mint
function mint(address recipient, uint256 amount) external onlyOwner {
unchecked {
if (totalSupply() + amount <= type(uint256).max / 2) {
_mint(recipient, amount);
}
}
}
/// @notice owner-only function to burn shares.
/// @param account Address to lose shares
/// @param amount Amount to burn
function burn(address account, uint256 amount) external onlyOwner {
_burn(account, amount);
}
/// @notice new before transfer
/// @dev Allows transfers if msg.sender is Baal which enables minting and burning
/// @param from The address of the source account.
/// @param to The address of the destination account.
/// @param amount The number of `shares` tokens to transfer.
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal override(BaalVotes) {
super._beforeTokenTransfer(from, to, amount);
}
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
}

View File

@ -1,41 +0,0 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "@openzeppelin/contracts/proxy/Clones.sol";
import "../Baal.sol";
contract MockBaal {
bool public lootPaused;
IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/
constructor(
address payable _lootSingleton,
string memory _name,
string memory _symbol
) {
/*Clone loot singleton using EIP1167 minimal proxy pattern*/
lootToken = IBaalToken(Clones.clone(_lootSingleton));
lootToken.setUp(
string(abi.encodePacked(_name, " LOOT")),
string(abi.encodePacked(_symbol, "-LOOT"))
);
}
function setLootPaused(bool paused) external {
if(!lootToken.paused() && paused){
lootToken.pause();
} else if(lootToken.paused() && !paused){
lootToken.unpause();
}
lootPaused = paused;
}
function mintLoot(address _to, uint256 _amount) external {
lootToken.mint(_to, _amount);
}
function burnLoot(address _from, uint256 _amount) external {
lootToken.burn(_from, _amount);
}
}

View File

@ -1,65 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity 0.8.7;
contract Enum {
enum Operation {
Call,
DelegateCall
}
}
contract TestAvatar {
address public module;
receive() external payable {}
function enableModule(address _module) external {
module = _module;
}
function disableModule(address, address) external {
module = address(0);
}
function isModuleEnabled(address _module) external view returns (bool) {
if (module == _module) {
return true;
} else {
return false;
}
}
function execTransactionFromModule(
address payable to,
uint256 value,
bytes calldata data,
uint8 operation
) external returns (bool success) {
require(msg.sender == module, "Not authorized");
if (operation == 1) (success, ) = to.delegatecall(data);
else (success, ) = to.call{value: value}(data);
}
function execTransactionFromModuleReturnData(
address payable to,
uint256 value,
bytes calldata data,
uint8 operation
) external returns (bool success, bytes memory returnData) {
require(msg.sender == module, "Not authorized");
if (operation == 1) (success, ) = to.delegatecall(data);
else (success, returnData) = to.call{value: value}(data);
}
function getModulesPaginated(address, uint256 pageSize)
external
view
returns (address[] memory array, address next)
{
// Init array with max page size
array = new address[](pageSize);
array[0] = module;
next = module;
}
}

View File

@ -1,51 +0,0 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
/// @notice Basic ERC20 implementation.
contract TestERC20 {
string public name;
string public symbol;
uint8 public constant decimals = 18;
uint256 public totalSupply;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(address indexed owner, address indexed spender, uint256 amount);
constructor(string memory _name, string memory _symbol, uint256 _totalSupply) {
name = _name;
symbol = _symbol;
totalSupply = _totalSupply;
balanceOf[msg.sender] = _totalSupply;
emit Transfer(address(0), msg.sender, _totalSupply);
}
function approve(address to, uint256 amount) external returns (bool) {
allowance[msg.sender][to] = amount;
emit Approval(msg.sender, to, amount);
return true;
}
function transfer(address to, uint256 amount) external returns (bool) {
balanceOf[msg.sender] -= amount;
balanceOf[to] += amount;
emit Transfer(msg.sender, to, amount);
return true;
}
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool) {
if (allowance[from][msg.sender] != type(uint256).max)
allowance[from][msg.sender] -= amount;
balanceOf[from] -= amount;
balanceOf[to] += amount;
emit Transfer(from, to, amount);
return true;
}
}

View File

@ -1,176 +0,0 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "../Baal.sol";
interface IERC20 {
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool);
}
contract TributeMinion {
event TributeProposal(
address indexed baal,
address token,
uint256 amount,
address recipient,
uint256 proposalId
);
struct Escrow {
address token;
address applicant;
uint256 amount;
bool released;
address safe;
}
mapping(address => mapping(uint256 => Escrow)) public escrows;
event EscrowReleased(
address indexed baal,
uint32 proposalId,
address applicant,
address safe,
uint256 amount
);
function encodeTributeProposal(
address baal,
uint256 shares,
uint256 loot,
address recipient,
uint32 proposalId,
address escrow
) public pure returns (bytes memory) {
// Workaround for solidity dynamic memory array
address[] memory _recipients = new address[](1);
_recipients[0] = recipient;
bytes memory _releaseEscrow = abi.encodeWithSignature(
"releaseEscrow(address,uint32)",
baal,
proposalId
);
bytes memory tributeMultisend = abi.encodePacked(
uint8(0),
escrow,
uint256(0),
uint256(_releaseEscrow.length),
bytes(_releaseEscrow)
);
if (shares > 0) {
// Workaround for solidity dynamic memory array
uint256[] memory _shares = new uint256[](1);
_shares[0] = shares;
bytes memory _issueShares = abi.encodeWithSignature(
"mintShares(address[],uint256[])",
_recipients,
_shares
);
tributeMultisend = abi.encodePacked(
tributeMultisend,
uint8(0),
baal,
uint256(0),
uint256(_issueShares.length),
bytes(_issueShares)
);
}
if (loot > 0) {
// Workaround for solidity dynamic memory array
uint256[] memory _loot = new uint256[](1);
_loot[0] = loot;
bytes memory _issueLoot = abi.encodeWithSignature(
"mintLoot(address[],uint256[])",
_recipients,
_loot
);
tributeMultisend = abi.encodePacked(
tributeMultisend,
uint8(0),
address(baal),
uint256(0),
uint256(_issueLoot.length),
bytes(_issueLoot)
);
}
bytes memory _multisendAction = abi.encodeWithSignature(
"multiSend(bytes)",
tributeMultisend
);
return _multisendAction;
}
function submitTributeProposal(
Baal baal,
address token,
uint256 amount,
uint256 shares,
uint256 loot,
uint32 expiration,
uint256 baalgas,
string memory details
) external payable {
uint32 proposalId = baal.proposalCount() + 1;
bytes memory encodedProposal = encodeTributeProposal(
address(baal),
shares,
loot,
msg.sender,
proposalId,
address(this)
);
escrows[address(baal)][proposalId] = Escrow(
token,
msg.sender,
amount,
false,
baal.target()
);
baal.submitProposal{value:msg.value}(encodedProposal, expiration, baalgas, details);
emit TributeProposal(
address(baal),
token,
amount,
msg.sender,
proposalId
);
}
function releaseEscrow(address _baal, uint32 _proposalId) external {
Baal baal = Baal(_baal);
Escrow storage escrow = escrows[address(baal)][_proposalId];
require(!escrow.released, "Already released");
bool[4] memory status = baal.getProposalStatus(_proposalId);
require(status[2], "Not passed");
escrow.released = true;
IERC20 token = IERC20(escrow.token);
emit EscrowReleased(
_baal,
_proposalId,
escrow.applicant,
escrow.safe,
escrow.amount
);
require(
token.transferFrom(escrow.applicant, escrow.safe, escrow.amount),
"Transfer failed"
);
}
}

View File

@ -1,252 +0,0 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol";
import "./DelegationEIP712Upgradeable.sol";
/**
* @dev similar to Openzeplin ERC20Votes
*
* uses timestamp instead of block.number and auto self delegates.
*
* This extension keeps a history (checkpoints) of each account's vote power. Vote power can be delegated either
* by calling the {delegate} function directly, or by providing a signature to be used with {delegateBySig}. Voting
* power can be queried through the public accessors {getPriorVotes}.
*
*/
abstract contract BaalVotes is ERC20PermitUpgradeable, DelegationEIP712Upgradeable {
using ECDSAUpgradeable for bytes32;
struct Checkpoint {
/*Baal checkpoint for marking number of delegated votes*/
uint32 fromTimePoint; /*unix time for referencing voting balance*/
uint256 votes; /*votes at given unix time*/
}
// DELEGATE TRACKING
mapping(address => mapping(uint256 => Checkpoint)) public checkpoints; /*maps record of vote `checkpoints` for each account by index*/
mapping(address => uint256) public numCheckpoints; /*maps number of `checkpoints` for each account*/
mapping(address => address) public delegates; /*maps record of each account's `shares` delegate*/
mapping(address => uint256) public delegationNonces; /*nonces for delegating by signature*/
// SIGNATURE HELPERS
bytes32 constant DELEGATION_TYPEHASH = keccak256("Delegation(string name,address delegatee,uint256 nonce,uint256 expiry)");
event DelegateChanged(
address indexed delegator,
address indexed fromDelegate,
address indexed toDelegate
); /*emits when an account changes its voting delegate*/
event DelegateVotesChanged(
address indexed delegate,
uint256 previousBalance,
uint256 newBalance
); /*emits when a delegate account's voting balance changes*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual override {
super._beforeTokenTransfer(from, to, amount);
/*If recipient is receiving their first shares, auto-self delegate*/
if (balanceOf(to) == 0 && numCheckpoints[to] == 0 && amount > 0) {
delegates[to] = to;
}
_moveDelegates(delegates[from], delegates[to], amount);
}
/// @notice Delegate votes from user to `delegatee`.
/// @param delegatee The address to delegate votes to.
function delegate(address delegatee) external virtual {
_delegate(msg.sender, delegatee);
}
/// @notice Delegates votes from `signer` to `delegatee` with EIP-712 signature.
/// @param delegatee The address to delegate 'votes' to.
/// @param nonce The contract state required to match the signature.
/// @param expiry The time at which to expire the signature.
/// @param v The v signature
/// @param r The r signature
/// @param s The s signature
function delegateBySig(
address delegatee,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) public {
require(now() <= expiry, "ERC20Votes: signature expired");
address signer = ECDSAUpgradeable.recover(
_hashTypedDataV4Delegation(
keccak256(
abi.encode(
DELEGATION_TYPEHASH,
keccak256(abi.encodePacked(name())),
delegatee,
nonce,
expiry
)
)
),
v,
r,
s
);
require(signer != address(0), "ERC20Votes: invalid signer (0x0)");
require(nonce == delegationNonces[signer], "ERC20Votes: invalid nonce");
delegationNonces[signer]++;
_delegate(signer, delegatee);
}
/// @notice Delegates Baal voting weight.
/// @param delegator The address to delegate 'votes' from.
/// @param delegatee The address to delegate 'votes' to.
function _delegate(address delegator, address delegatee) internal virtual {
require(balanceOf(delegator) > 0, "!shares");
address currentDelegate = delegates[delegator];
delegates[delegator] = delegatee;
_moveDelegates(
currentDelegate,
delegatee,
uint256(balanceOf(delegator))
);
emit DelegateChanged(delegator, currentDelegate, delegatee);
}
/// @notice Elaborates delegate update - cf., 'Compound Governance'.
/// @param srcRep The address to delegate 'votes' from.
/// @param dstRep The address to delegate 'votes' to.
/// @param amount The amount of votes to delegate
function _moveDelegates(
address srcRep,
address dstRep,
uint256 amount
) private {
unchecked {
if (srcRep != dstRep && amount != 0) {
if (srcRep != address(0)) {
uint256 srcRepNum = numCheckpoints[srcRep];
uint256 srcRepOld = srcRepNum != 0
? getCheckpoint(srcRep, srcRepNum - 1).votes
: 0;
uint256 srcRepNew = srcRepOld - amount;
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint256 dstRepNum = numCheckpoints[dstRep];
uint256 dstRepOld = dstRepNum != 0
? getCheckpoint(dstRep, dstRepNum - 1).votes
: 0;
uint256 dstRepNew = dstRepOld + amount;
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
}
/// @notice Elaborates delegate update - cf., 'Compound Governance'.
/// @param delegatee The address to snapshot
/// @param nCheckpoints The number of checkpoints delegatee has
/// @param oldVotes The number of votes the delegatee had
/// @param newVotes The number of votes the delegate has now
function _writeCheckpoint(
address delegatee,
uint256 nCheckpoints,
uint256 oldVotes,
uint256 newVotes
) private {
uint32 timePoint = uint32(now());
unchecked {
if (
nCheckpoints != 0 &&
checkpoints[delegatee][nCheckpoints - 1].fromTimePoint == timePoint
) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(
timePoint,
newVotes
);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
/// @notice Returns the current timepoint.
/// @return timePoint returns unix epoch timestamp
function now() public view returns (uint256 timePoint) {
return block.timestamp;
}
/// @notice Returns the prior number of `votes` for `account` as of `timePoint`.
/// @param account The user to check `votes` for.
/// @param timePoint The unix time to check `votes` for.
/// @return votes Past `votes` delegated to `account`.
function getPastVotes(address account, uint256 timePoint)
external
view
virtual
returns (uint256 votes)
{
require(timePoint < now(), "!determined"); /* Prior votes must be in the past*/
uint256 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) return 0;
unchecked {
if (
getCheckpoint(account, nCheckpoints - 1).fromTimePoint <=
timePoint
) return getCheckpoint(account, nCheckpoints - 1).votes; /* If most recent checkpoint is at or after desired timepoint, return*/
if (getCheckpoint(account, 0).fromTimePoint > timePoint) return 0;
uint256 lower = 0;
uint256 upper = nCheckpoints - 1;
while (upper > lower) {
/* Binary search to look for highest timePoint before desired timePoint*/
uint256 center = upper - (upper - lower) / 2;
Checkpoint memory cp = getCheckpoint(account, center);
if (cp.fromTimePoint == timePoint) return cp.votes;
else if (cp.fromTimePoint < timePoint) lower = center;
else upper = center - 1;
}
votes = getCheckpoint(account, lower).votes;
}
}
/// @notice Returns the current delegated `vote` balance for `account`.
/// @param account The user to check delegated `votes` for.
/// @return votes Current `votes` delegated to `account`.
function getVotes(address account)
external
view
virtual
returns (uint256 votes)
{
uint256 nCheckpoints = numCheckpoints[account]; /*Get most recent checkpoint, or 0 if no checkpoints*/
unchecked {
votes = nCheckpoints != 0
? getCheckpoint(account, nCheckpoints - 1).votes
: 0;
}
}
function getCheckpoint(address delegatee, uint256 nCheckpoints)
public
view
virtual
returns (Checkpoint memory)
{
return checkpoints[delegatee][nCheckpoints];
}
}

View File

@ -1,121 +0,0 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
/**
* @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
*
* The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
* thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
* they need in their contracts using a combination of `abi.encode` and `keccak256`.
*
* This contract implements the EIP 712 domain separator ({_domainSeparatorV4Delegation}) that is used as part of the encoding
* scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
* ({_hashTypedDataV4Delegation}).
*
* The implementation of the domain separator was designed to be as efficient as possible while still properly updating
* the chain id to protect against replay attacks on an eventual fork of the chain.
*
* NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
* https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
*
* _Available since v3.4._
*
* @custom:storage-size 52
*/
abstract contract DelegationEIP712Upgradeable is Initializable {
/* solhint-disable var-name-mixedcase */
bytes32 private _HASHED_NAME_DELEGATION;
bytes32 private _HASHED_VERSION_DELEGATION;
bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
/* solhint-enable var-name-mixedcase */
/**
* @dev Initializes the domain separator and parameter caches.
*
* The meaning of `name` and `version` is specified in
* https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
*
* - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
* - `version`: the current major version of the signing domain.
*
* NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
* contract upgrade].
*/
function __EIP712_init_delegation(string memory name, string memory version) internal onlyInitializing {
__EIP712_init_unchained_delegation(name, version);
}
function __EIP712_init_unchained_delegation(string memory name, string memory version) internal onlyInitializing {
bytes32 hashedName = keccak256(bytes(name));
bytes32 hashedVersion = keccak256(bytes(version));
_HASHED_NAME_DELEGATION = hashedName;
_HASHED_VERSION_DELEGATION = hashedVersion;
}
/**
* @dev Returns the domain separator for the current chain.
*/
function _domainSeparatorV4Delegation() internal view returns (bytes32) {
return _buildDomainSeparatorDelegation(_TYPE_HASH, _EIP712NameHashDelegation(), _EIP712VersionHashDelegation());
}
function _buildDomainSeparatorDelegation(
bytes32 typeHash,
bytes32 nameHash,
bytes32 versionHash
) private view returns (bytes32) {
return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));
}
/**
* @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
* function returns the hash of the fully encoded EIP712 message for this domain.
*
* This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
*
* ```solidity
* bytes32 digest = _hashTypedDataV4Delegation(keccak256(abi.encode(
* keccak256("Mail(address to,string contents)"),
* mailTo,
* keccak256(bytes(mailContents))
* )));
* address signer = ECDSA.recover(digest, signature);
* ```
*/
function _hashTypedDataV4Delegation(bytes32 structHash) internal view virtual returns (bytes32) {
return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4Delegation(), structHash);
}
/**
* @dev The hash of the name parameter for the EIP712 domain.
*
* NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
* are a concern.
*/
function _EIP712NameHashDelegation() internal virtual view returns (bytes32) {
return _HASHED_NAME_DELEGATION;
}
/**
* @dev The hash of the version parameter for the EIP712 domain.
*
* NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
* are a concern.
*/
function _EIP712VersionHashDelegation() internal virtual view returns (bytes32) {
return _HASHED_VERSION_DELEGATION;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}

View File

@ -1,22 +0,0 @@
/*
A ridiculously simple general purpose social media smart contract.
It takes two strings (content and tag) as parameters and emits those strings, along with msg.sender, as an event. That's it.
Made with by Auryn.eth
*/
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity 0.8.7;
contract Poster {
event NewPost(address indexed user, string content, string indexed tag);
function post(string calldata content, string calldata tag) external {
emit NewPost(msg.sender, content, tag);
}
}

View File

@ -1,61 +0,0 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { deployments, getNamedAccounts, network } = hre;
const { deployer } = await getNamedAccounts();
if (network.name === 'hardhat') {
console.log('Deploying Safe infra locally...');
const { deploy } = deployments;
const multisendDeployed = await deploy('MultiSend', {
contract: 'MultiSend',
from: deployer,
args: [],
log: false,
});
const safeDeployed = await deploy('GnosisSafe', {
contract: 'GnosisSafe',
from: deployer,
args: [],
log: false,
});
const cfhDeployed = await deploy('CompatibilityFallbackHandler', {
contract: 'CompatibilityFallbackHandler',
from: deployer,
args: [],
log: false,
});
const safepfDeployed = await deploy('GnosisSafeProxyFactory', {
contract: 'GnosisSafeProxyFactory',
from: deployer,
args: [],
log: false,
});
const safemfDeployed = await deploy('ModuleProxyFactory', {
contract: 'ModuleProxyFactory',
from: deployer,
args: [],
log: false,
});
console.log('Deployed Safe Infra:\n');
console.log('Multisend ->', multisendDeployed.address);
console.log('CompatibilityFallbackHandler ->', cfhDeployed.address);
console.log('ModuleProxyFactory ->', safemfDeployed.address);
console.log('Safe Singleton ->', safeDeployed.address);
console.log('GnosisSafeProxyFactor ->y', safepfDeployed.address);
}
};
export default deployFn;
deployFn.tags = ['Infra', 'Safe'];

View File

@ -1,27 +0,0 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { deployments, ethers, getChainId, getNamedAccounts, network } = hre;
const { deployer } = await getNamedAccounts();
const chainId = await getChainId();
console.log('\n\nDeploying Poster on network:', network.name);
console.log('Deployer address:', `${chainId}:${deployer}`);
console.log(
'Deployer balance:',
ethers.utils.formatEther(await ethers.provider.getBalance(deployer)),
);
const { deploy } = deployments;
await deploy('Poster', {
contract: 'Poster',
from: deployer,
args: [],
log: true,
});
}
export default deployFn;
deployFn.tags = ['Infra', 'Poster'];

View File

@ -1,27 +0,0 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { deployments, ethers, getChainId, getNamedAccounts, network } = hre;
const { deployer } = await getNamedAccounts();
const chainId = await getChainId();
console.log('\n\nDeploying TributeMinion on network:', network.name);
console.log('Deployer address:', `${chainId}:${deployer}`);
console.log(
'Deployer balance:',
ethers.utils.formatEther(await ethers.provider.getBalance(deployer)),
);
const { deploy } = deployments;
await deploy('TributeMinion', {
contract: 'TributeMinion',
from: deployer,
args: [],
log: true,
});
}
export default deployFn;
deployFn.tags = ['TributeMinion'];

View File

@ -1,91 +0,0 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { getSetupAddresses } from '../src/addresses/setup';
const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { deployments, ethers, getChainId, getNamedAccounts, network } = hre;
const { deployer } = await getNamedAccounts();
const chainId = await getChainId();
const _addresses = await getSetupAddresses(chainId, network, deployments);
if ((!_addresses.DAO || _addresses.DAO === ethers.constants.AddressZero) && network.name !== 'hardhat') {
console.log('You need to set DAO address to transfer ownership of summoner', _addresses.DAO);
return;
}
console.log('\n\nDeploying BaalSummoner factory on network:', network.name);
console.log('Deployer address:', `${chainId}:${deployer}`);
console.log(
'Deployer balance:',
ethers.utils.formatEther(await ethers.provider.getBalance(deployer)),
);
const { deploy } = deployments;
const lootSingleton = await deploy('Loot', {
contract: 'Loot',
from: deployer,
args: [],
log: true,
});
const sharesSingleton = await deploy('Shares', {
contract: 'Shares',
from: deployer,
args: [],
log: true,
});
const baalSingleton = await deploy('Baal', {
contract: 'Baal',
from: deployer,
args: [],
log: true,
});
const summonerDeeployed = await deploy('BaalSummoner', {
contract: 'BaalSummoner',
from: deployer,
args: [],
proxy: {
proxyContract: 'UUPS',
methodName: 'initialize',
},
log: true,
});
console.log('BaalSummoner deployment Tx ->', summonerDeeployed.transactionHash);
// set addresses of templates and libraries
const tx_1 = await deployments.execute('BaalSummoner', {
from: deployer,
}, 'setAddrs',
baalSingleton.address,
_addresses.gnosisSingleton,
_addresses.gnosisFallbackLibrary,
_addresses.gnosisMultisendLibrary,
_addresses.gnosisSafeProxyFactory,
_addresses.moduleProxyFactory,
lootSingleton.address,
sharesSingleton.address
);
console.log('BaalSummoner setAddrs Tx ->', tx_1.transactionHash);
// transfer ownership to DAO
if (network.name !== 'hardhat') {
console.log("BaalSummoner transferOwnership to", _addresses.DAO);
const tx_2 = await deployments.execute('BaalSummoner', {
from: deployer,
}, 'transferOwnership',
_addresses.DAO
);
console.log('BaalSummoner transferOwnership Tx ->', tx_2.transactionHash);
}
};
export default deployFn;
deployFn.tags = ['Factories', 'BaalSummoner'];

View File

@ -1,63 +0,0 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { getSetupAddresses } from '../src/addresses/setup';
const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { deployments, ethers, getChainId, getNamedAccounts, network } = hre;
const { deployer } = await getNamedAccounts();
const chainId = await getChainId();
const _addresses = await getSetupAddresses(chainId, network, deployments);
if ((!_addresses.DAO || _addresses.DAO === ethers.constants.AddressZero) && network.name !== 'hardhat') {
console.log('You need to set DAO address to transfer ownership of summoner', _addresses.DAO);
return;
}
console.log('\n\Deploying BaalAndVaultSummoner factory on network:', network.name);
console.log('Deployer address:', `${chainId}:${deployer}`);
console.log(
'Deployer balance:',
ethers.utils.formatEther(await ethers.provider.getBalance(deployer)),
);
const { deploy } = deployments;
const baalSummoner = await deployments.get('BaalSummoner');
console.log('BaalSummoner address', baalSummoner.address);
const summonerDeeployed = await deploy('BaalAndVaultSummoner', {
contract: 'BaalAndVaultSummoner',
from: deployer,
args: [],
proxy: {
proxyContract: 'UUPS',
methodName: 'initialize',
},
log: true,
});
console.log('BaalSummoner deployment Tx ->', summonerDeeployed.transactionHash);
const tx_3 = await deployments.execute('BaalAndVaultSummoner', {
from: deployer,
}, 'setSummonerAddr',
baalSummoner.address
);
console.log('BaalAndVaultSummoner setSummonerAddr Tx ->', tx_3.transactionHash);
if (network.name !== 'hardhat') {
console.log("BaalAndVaultSummoner transferOwnership to", _addresses.DAO);
const tx_4 = await deployments.execute('BaalAndVaultSummoner', {
from: deployer,
}, 'transferOwnership',
_addresses.DAO
);
console.log('BaalAndVaultSummoner transferOwnership Tx ->', tx_4.transactionHash);
}
};
export default deployFn;
deployFn.tags = ['Factories', 'BaalAndVaultSummoner'];

View File

@ -1,72 +0,0 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployments as logDeployments } from '../src/addresses/deployed';
import { getSetupAddresses } from '../src/addresses/setup';
type SupportedNetwork = keyof typeof logDeployments[0]['v103'];
const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { deployments, ethers, getChainId, getNamedAccounts, network } = hre;
const { deployer } = await getNamedAccounts();
const chainId = await getChainId();
const _addresses = await getSetupAddresses(chainId, network, deployments);
if ((!_addresses.DAO || _addresses.DAO === ethers.constants.AddressZero) && network.name !== 'hardhat') {
console.log('You need to set DAO address to transfer ownership of summoner', _addresses.DAO);
return;
}
console.log('\n\nDeploying BaalAdvTokenSummoner(UUPS) factory on network:', network.name);
console.log('Deployer address:', `${chainId}:${deployer}`);
console.log(
'Deployer balance:',
ethers.utils.formatEther(await ethers.provider.getBalance(deployer)),
);
const { deploy } = deployments;
let baalSummonerAddress = logDeployments[0]['v103'][network.name as SupportedNetwork]?.addresses?.factory;
if (!network.live || !baalSummonerAddress) {
const baal = await deployments.get('BaalSummoner');
baalSummonerAddress = baal.address;
}
console.log('BaalSummoner address', baalSummonerAddress);
const summonerDeeployed = await deploy('BaalAdvTokenSummoner', {
contract: 'BaalAdvTokenSummoner',
from: deployer,
args: [],
proxy: {
proxyContract: 'UUPS',
methodName: 'initialize',
},
log: true,
});
console.log('BaalSummoner deployment Tx ->', summonerDeeployed.transactionHash);
const tx_1 = await deployments.execute('BaalAdvTokenSummoner', {
from: deployer,
}, 'setSummonerAddr',
baalSummonerAddress
);
console.log('BaalAdvTokenSummoner setSummonerAddr Tx ->', tx_1.transactionHash);
// transfer ownership to DAO
if (network.name !== 'hardhat') {
console.log("BaalAdvTokenSummoner transferOwnership to", _addresses.DAO);
const tx_2 = await deployments.execute('BaalAdvTokenSummoner', {
from: deployer,
}, 'transferOwnership',
_addresses.DAO
);
console.log('BaalAdvTokenSummoner transferOwnership Tx ->', tx_2.transactionHash);
}
};
export default deployFn;
deployFn.tags = ['Factories', 'BaalAdvTokenSummoner'];

View File

@ -1,42 +0,0 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
const { ethers, upgrades } = require("hardhat");
import { DeployFunction } from 'hardhat-deploy/types';
import { getSetupAddresses } from '../src/addresses/setup';
const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { deployments, ethers, getChainId, getNamedAccounts, network } = hre;
const { deployer } = await getNamedAccounts();
const chainId = await getChainId();
const _addresses = await getSetupAddresses(chainId, network, deployments);
if ((!_addresses.DAO || _addresses.DAO === ethers.constants.AddressZero) && network.name !== 'hardhat') {
console.log('You need to set DAO address to transfer ownership of summoner', _addresses.DAO);
return;
}
console.log('\n\nDeploying BaalSummoner factory on network:', network.name);
console.log('Deployer address:', `${chainId}:${deployer}`);
console.log(
'Deployer balance:',
ethers.utils.formatEther(await ethers.provider.getBalance(deployer)),
);
const { deploy } = deployments;
const summonerDeeployed = await deploy('BaalSummoner', {
contract: 'BaalSummoner',
from: deployer,
args: [],
log: true,
});
console.log('BaalSummoner deployment Tx ->', summonerDeeployed.transactionHash);
};
export default deployFn;
deployFn.tags = ['UpgradeBaalSummoner'];

View File

@ -1 +0,0 @@
42161

File diff suppressed because it is too large Load Diff

View File

@ -1,330 +0,0 @@
{
"address": "0x8a4A9E36106Ee290811B89e06e2faFE913507965",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "previousAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "AdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "beacon",
"type": "address"
}
],
"name": "BeaconUpgraded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
},
{
"stateMutability": "payable",
"type": "fallback"
},
{
"inputs": [],
"name": "admin",
"outputs": [
{
"internalType": "address",
"name": "admin_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "changeAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "implementation",
"outputs": [
{
"internalType": "address",
"name": "implementation_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
}
],
"name": "upgradeTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "upgradeToAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "lootToken",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "sharesToken",
"type": "address"
}
],
"name": "DeployBaalTokens",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "summoner",
"type": "address"
}
],
"name": "setSummoner",
"type": "event"
},
{
"inputs": [],
"name": "_baalSummoner",
"outputs": [
{
"internalType": "contract IBaalSummoner",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "proxiableUUID",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "baalSummoner",
"type": "address"
}
],
"name": "setSummonerAddr",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_safeAddr",
"type": "address"
},
{
"internalType": "address",
"name": "_forwarderAddr",
"type": "address"
},
{
"internalType": "uint256",
"name": "_saltNonce",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "initializationMintParams",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "initializationTokenParams",
"type": "bytes"
},
{
"internalType": "bytes[]",
"name": "postInitializationActions",
"type": "bytes[]"
}
],
"name": "summonBaalFromReferrer",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_logic",
"type": "address"
},
{
"internalType": "address",
"name": "admin_",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"stateMutability": "payable",
"type": "constructor"
}
]
}

View File

@ -1,262 +0,0 @@
{
"address": "0x0858CB45cE9300133FEbf2Ee2179441c6BadFcdD",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "previousAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "AdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "beacon",
"type": "address"
}
],
"name": "BeaconUpgraded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "lootToken",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "sharesToken",
"type": "address"
}
],
"name": "DeployBaalTokens",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "summoner",
"type": "address"
}
],
"name": "setSummoner",
"type": "event"
},
{
"inputs": [],
"name": "_baalSummoner",
"outputs": [
{
"internalType": "contract IBaalSummoner",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "proxiableUUID",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "baalSummoner",
"type": "address"
}
],
"name": "setSummonerAddr",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_safeAddr",
"type": "address"
},
{
"internalType": "address",
"name": "_forwarderAddr",
"type": "address"
},
{
"internalType": "uint256",
"name": "_saltNonce",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "initializationMintParams",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "initializationTokenParams",
"type": "bytes"
},
{
"internalType": "bytes[]",
"name": "postInitializationActions",
"type": "bytes[]"
}
],
"name": "summonBaalFromReferrer",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
}
],
"name": "upgradeTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "upgradeToAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
}
]
}

View File

@ -1,149 +0,0 @@
{
"address": "0x8a4A9E36106Ee290811B89e06e2faFE913507965",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_logic",
"type": "address"
},
{
"internalType": "address",
"name": "admin_",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"stateMutability": "payable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "previousAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "AdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "beacon",
"type": "address"
}
],
"name": "BeaconUpgraded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
},
{
"stateMutability": "payable",
"type": "fallback"
},
{
"inputs": [],
"name": "admin",
"outputs": [
{
"internalType": "address",
"name": "admin_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "changeAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "implementation",
"outputs": [
{
"internalType": "address",
"name": "implementation_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
}
],
"name": "upgradeTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "upgradeToAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
]
}

View File

@ -1,548 +0,0 @@
{
"address": "0xC39E8D4DE75c6aC025a0C07dCd8Aeb0728C5DBF1",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "previousAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "AdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "beacon",
"type": "address"
}
],
"name": "BeaconUpgraded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
},
{
"stateMutability": "payable",
"type": "fallback"
},
{
"inputs": [],
"name": "admin",
"outputs": [
{
"internalType": "address",
"name": "admin_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "changeAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "implementation",
"outputs": [
{
"internalType": "address",
"name": "implementation_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
}
],
"name": "upgradeTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "upgradeToAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "daoAddress",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "delegate",
"type": "address"
}
],
"name": "SetDelegate",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"components": [
{
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"internalType": "bool",
"name": "active",
"type": "bool"
},
{
"internalType": "address",
"name": "daoAddress",
"type": "address"
},
{
"internalType": "address",
"name": "vaultAddress",
"type": "address"
},
{
"internalType": "string",
"name": "name",
"type": "string"
}
],
"indexed": false,
"internalType": "struct BaalAndVaultSummoner.Vault",
"name": "vault",
"type": "tuple"
}
],
"name": "SetVault",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "summoner",
"type": "address"
}
],
"name": "setSummoner",
"type": "event"
},
{
"inputs": [],
"name": "_baalSummoner",
"outputs": [
{
"internalType": "contract IBaalSummoner",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"internalType": "address",
"name": "daoAddress",
"type": "address"
}
],
"name": "deactivateVaultAsDao",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "delegates",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "proxiableUUID",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "daoAddress",
"type": "address"
},
{
"internalType": "address",
"name": "delegate",
"type": "address"
}
],
"name": "setDelegate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "daoAddress",
"type": "address"
},
{
"internalType": "address",
"name": "vaultAddress",
"type": "address"
},
{
"internalType": "string",
"name": "name",
"type": "string"
}
],
"name": "setNewVault",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "baalSummoner",
"type": "address"
}
],
"name": "setSummonerAddr",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"internalType": "bool",
"name": "active",
"type": "bool"
}
],
"name": "setVault",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "initializationParams",
"type": "bytes"
},
{
"internalType": "bytes[]",
"name": "initializationActions",
"type": "bytes[]"
},
{
"internalType": "uint256",
"name": "saltNonce",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "referrer",
"type": "bytes32"
},
{
"internalType": "string",
"name": "name",
"type": "string"
}
],
"name": "summonBaalAndVault",
"outputs": [
{
"internalType": "address",
"name": "_daoAddress",
"type": "address"
},
{
"internalType": "address",
"name": "_vaultAddress",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "daoAddress",
"type": "address"
},
{
"internalType": "string",
"name": "name",
"type": "string"
}
],
"name": "summonVault",
"outputs": [
{
"internalType": "address",
"name": "_vaultAddress",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "vaultIdx",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "vaults",
"outputs": [
{
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"internalType": "bool",
"name": "active",
"type": "bool"
},
{
"internalType": "address",
"name": "daoAddress",
"type": "address"
},
{
"internalType": "address",
"name": "vaultAddress",
"type": "address"
},
{
"internalType": "string",
"name": "name",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_logic",
"type": "address"
},
{
"internalType": "address",
"name": "admin_",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"stateMutability": "payable",
"type": "constructor"
}
]
}

View File

@ -1,480 +0,0 @@
{
"address": "0x2a9886Bd3Dc34f05d56650105F5239F441FA2EDd",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "previousAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "AdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "beacon",
"type": "address"
}
],
"name": "BeaconUpgraded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "daoAddress",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "delegate",
"type": "address"
}
],
"name": "SetDelegate",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"components": [
{
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"internalType": "bool",
"name": "active",
"type": "bool"
},
{
"internalType": "address",
"name": "daoAddress",
"type": "address"
},
{
"internalType": "address",
"name": "vaultAddress",
"type": "address"
},
{
"internalType": "string",
"name": "name",
"type": "string"
}
],
"indexed": false,
"internalType": "struct BaalAndVaultSummoner.Vault",
"name": "vault",
"type": "tuple"
}
],
"name": "SetVault",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "summoner",
"type": "address"
}
],
"name": "setSummoner",
"type": "event"
},
{
"inputs": [],
"name": "_baalSummoner",
"outputs": [
{
"internalType": "contract IBaalSummoner",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"internalType": "address",
"name": "daoAddress",
"type": "address"
}
],
"name": "deactivateVaultAsDao",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "delegates",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "proxiableUUID",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "daoAddress",
"type": "address"
},
{
"internalType": "address",
"name": "delegate",
"type": "address"
}
],
"name": "setDelegate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "daoAddress",
"type": "address"
},
{
"internalType": "address",
"name": "vaultAddress",
"type": "address"
},
{
"internalType": "string",
"name": "name",
"type": "string"
}
],
"name": "setNewVault",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "baalSummoner",
"type": "address"
}
],
"name": "setSummonerAddr",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"internalType": "bool",
"name": "active",
"type": "bool"
}
],
"name": "setVault",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "initializationParams",
"type": "bytes"
},
{
"internalType": "bytes[]",
"name": "initializationActions",
"type": "bytes[]"
},
{
"internalType": "uint256",
"name": "saltNonce",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "referrer",
"type": "bytes32"
},
{
"internalType": "string",
"name": "name",
"type": "string"
}
],
"name": "summonBaalAndVault",
"outputs": [
{
"internalType": "address",
"name": "_daoAddress",
"type": "address"
},
{
"internalType": "address",
"name": "_vaultAddress",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "daoAddress",
"type": "address"
},
{
"internalType": "string",
"name": "name",
"type": "string"
}
],
"name": "summonVault",
"outputs": [
{
"internalType": "address",
"name": "_vaultAddress",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
}
],
"name": "upgradeTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "upgradeToAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "vaultIdx",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "vaults",
"outputs": [
{
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"internalType": "bool",
"name": "active",
"type": "bool"
},
{
"internalType": "address",
"name": "daoAddress",
"type": "address"
},
{
"internalType": "address",
"name": "vaultAddress",
"type": "address"
},
{
"internalType": "string",
"name": "name",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
}
]
}

View File

@ -1,149 +0,0 @@
{
"address": "0xC39E8D4DE75c6aC025a0C07dCd8Aeb0728C5DBF1",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_logic",
"type": "address"
},
{
"internalType": "address",
"name": "admin_",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"stateMutability": "payable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "previousAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "AdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "beacon",
"type": "address"
}
],
"name": "BeaconUpgraded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
},
{
"stateMutability": "payable",
"type": "fallback"
},
{
"inputs": [],
"name": "admin",
"outputs": [
{
"internalType": "address",
"name": "admin_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "changeAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "implementation",
"outputs": [
{
"internalType": "address",
"name": "implementation_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
}
],
"name": "upgradeTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "upgradeToAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
]
}

View File

@ -1,621 +0,0 @@
{
"address": "0xb08Cc8C343cF6dC20d8cf51Fb2D6C436c6390dAa",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "previousAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "AdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "beacon",
"type": "address"
}
],
"name": "BeaconUpgraded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
},
{
"stateMutability": "payable",
"type": "fallback"
},
{
"inputs": [],
"name": "admin",
"outputs": [
{
"internalType": "address",
"name": "admin_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "changeAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "implementation",
"outputs": [
{
"internalType": "address",
"name": "implementation_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
}
],
"name": "upgradeTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "upgradeToAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "bytes32",
"name": "referrer",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "address",
"name": "daoAddress",
"type": "address"
}
],
"name": "DaoReferral",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "baalSafe",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "moduleAddr",
"type": "address"
}
],
"name": "DeployBaalSafe",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "lootToken",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "sharesToken",
"type": "address"
}
],
"name": "DeployBaalTokens",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "version",
"type": "uint256"
}
],
"name": "SetAddrsVersion",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "baal",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "loot",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "shares",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "safe",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "forwarder",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "existingAddrs",
"type": "uint256"
}
],
"name": "SummonBaal",
"type": "event"
},
{
"inputs": [],
"name": "addrsVersion",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_moduleAddr",
"type": "address"
}
],
"name": "deployAndSetupSafe",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_symbol",
"type": "string"
}
],
"name": "deployTokens",
"outputs": [
{
"internalType": "address",
"name": "lootToken",
"type": "address"
},
{
"internalType": "address",
"name": "sharesToken",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes[]",
"name": "_calls",
"type": "bytes[]"
},
{
"internalType": "address",
"name": "_target",
"type": "address"
}
],
"name": "encodeMultisend",
"outputs": [
{
"internalType": "bytes",
"name": "encodedMultisend",
"type": "bytes"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "gnosisFallbackLibrary",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "gnosisMultisendLibrary",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "gnosisSingleton",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "lootSingleton",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "proxiableUUID",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "_template",
"type": "address"
},
{
"internalType": "address",
"name": "_gnosisSingleton",
"type": "address"
},
{
"internalType": "address",
"name": "_gnosisFallbackLibrary",
"type": "address"
},
{
"internalType": "address",
"name": "_gnosisMultisendLibrary",
"type": "address"
},
{
"internalType": "address",
"name": "_gnosisSafeProxyFactory",
"type": "address"
},
{
"internalType": "address",
"name": "_moduleProxyFactory",
"type": "address"
},
{
"internalType": "address",
"name": "_lootSingleton",
"type": "address"
},
{
"internalType": "address",
"name": "_sharesSingleton",
"type": "address"
}
],
"name": "setAddrs",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "sharesSingleton",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "initializationParams",
"type": "bytes"
},
{
"internalType": "bytes[]",
"name": "initializationActions",
"type": "bytes[]"
},
{
"internalType": "uint256",
"name": "_saltNonce",
"type": "uint256"
}
],
"name": "summonBaal",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "initializationParams",
"type": "bytes"
},
{
"internalType": "bytes[]",
"name": "initializationActions",
"type": "bytes[]"
},
{
"internalType": "uint256",
"name": "_saltNonce",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "referrer",
"type": "bytes32"
}
],
"name": "summonBaalFromReferrer",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "template",
"outputs": [
{
"internalType": "address payable",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_logic",
"type": "address"
},
{
"internalType": "address",
"name": "admin_",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"stateMutability": "payable",
"type": "constructor"
}
]
}

View File

@ -1,553 +0,0 @@
{
"address": "0x7e988A9db2F8597735fc68D21060Daed948a3e8C",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "previousAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "AdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "beacon",
"type": "address"
}
],
"name": "BeaconUpgraded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "bytes32",
"name": "referrer",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "address",
"name": "daoAddress",
"type": "address"
}
],
"name": "DaoReferral",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "baalSafe",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "moduleAddr",
"type": "address"
}
],
"name": "DeployBaalSafe",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "lootToken",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "sharesToken",
"type": "address"
}
],
"name": "DeployBaalTokens",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "version",
"type": "uint256"
}
],
"name": "SetAddrsVersion",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "baal",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "loot",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "shares",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "safe",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "forwarder",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "existingAddrs",
"type": "uint256"
}
],
"name": "SummonBaal",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
},
{
"inputs": [],
"name": "addrsVersion",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_moduleAddr",
"type": "address"
}
],
"name": "deployAndSetupSafe",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_symbol",
"type": "string"
}
],
"name": "deployTokens",
"outputs": [
{
"internalType": "address",
"name": "lootToken",
"type": "address"
},
{
"internalType": "address",
"name": "sharesToken",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes[]",
"name": "_calls",
"type": "bytes[]"
},
{
"internalType": "address",
"name": "_target",
"type": "address"
}
],
"name": "encodeMultisend",
"outputs": [
{
"internalType": "bytes",
"name": "encodedMultisend",
"type": "bytes"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "gnosisFallbackLibrary",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "gnosisMultisendLibrary",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "gnosisSingleton",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "lootSingleton",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "proxiableUUID",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "_template",
"type": "address"
},
{
"internalType": "address",
"name": "_gnosisSingleton",
"type": "address"
},
{
"internalType": "address",
"name": "_gnosisFallbackLibrary",
"type": "address"
},
{
"internalType": "address",
"name": "_gnosisMultisendLibrary",
"type": "address"
},
{
"internalType": "address",
"name": "_gnosisSafeProxyFactory",
"type": "address"
},
{
"internalType": "address",
"name": "_moduleProxyFactory",
"type": "address"
},
{
"internalType": "address",
"name": "_lootSingleton",
"type": "address"
},
{
"internalType": "address",
"name": "_sharesSingleton",
"type": "address"
}
],
"name": "setAddrs",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "sharesSingleton",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "initializationParams",
"type": "bytes"
},
{
"internalType": "bytes[]",
"name": "initializationActions",
"type": "bytes[]"
},
{
"internalType": "uint256",
"name": "_saltNonce",
"type": "uint256"
}
],
"name": "summonBaal",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "initializationParams",
"type": "bytes"
},
{
"internalType": "bytes[]",
"name": "initializationActions",
"type": "bytes[]"
},
{
"internalType": "uint256",
"name": "_saltNonce",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "referrer",
"type": "bytes32"
}
],
"name": "summonBaalFromReferrer",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "template",
"outputs": [
{
"internalType": "address payable",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
}
],
"name": "upgradeTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "upgradeToAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
}
]
}

View File

@ -1,149 +0,0 @@
{
"address": "0xb08Cc8C343cF6dC20d8cf51Fb2D6C436c6390dAa",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_logic",
"type": "address"
},
{
"internalType": "address",
"name": "admin_",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"stateMutability": "payable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "previousAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "AdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "beacon",
"type": "address"
}
],
"name": "BeaconUpgraded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
},
{
"stateMutability": "payable",
"type": "fallback"
},
{
"inputs": [],
"name": "admin",
"outputs": [
{
"internalType": "address",
"name": "admin_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "changeAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "implementation",
"outputs": [
{
"internalType": "address",
"name": "implementation_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
}
],
"name": "upgradeTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "upgradeToAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
]
}

View File

@ -1,698 +0,0 @@
{
"address": "0x0444AE984b9563C8480244693ED65F25B3C64a4E",
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "previousAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "AdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "beacon",
"type": "address"
}
],
"name": "BeaconUpgraded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "Paused",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "id",
"type": "uint256"
}
],
"name": "Snapshot",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "Unpaused",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
},
{
"inputs": [],
"name": "DOMAIN_SEPARATOR",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "uint256",
"name": "snapshotId",
"type": "uint256"
}
],
"name": "balanceOfAt",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "burn",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "subtractedValue",
"type": "uint256"
}
],
"name": "decreaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getCurrentSnapshotId",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "addedValue",
"type": "uint256"
}
],
"name": "increaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "mint",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "nonces",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pause",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "paused",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
},
{
"internalType": "uint8",
"name": "v",
"type": "uint8"
},
{
"internalType": "bytes32",
"name": "r",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "s",
"type": "bytes32"
}
],
"name": "permit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "proxiableUUID",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "name_",
"type": "string"
},
{
"internalType": "string",
"name": "symbol_",
"type": "string"
}
],
"name": "setUp",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "snapshot",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "snapshotId",
"type": "uint256"
}
],
"name": "totalSupplyAt",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "unpause",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
}
],
"name": "upgradeTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "upgradeToAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
}
]
}

View File

@ -1,48 +0,0 @@
{
"address": "0x000000000000cd17345801aa8147b8D3950260FF",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "user",
"type": "address"
},
{
"indexed": false,
"internalType": "string",
"name": "content",
"type": "string"
},
{
"indexed": true,
"internalType": "string",
"name": "tag",
"type": "string"
}
],
"name": "NewPost",
"type": "event"
},
{
"inputs": [
{
"internalType": "string",
"name": "content",
"type": "string"
},
{
"internalType": "string",
"name": "tag",
"type": "string"
}
],
"name": "post",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
}

View File

@ -1,977 +0,0 @@
{
"address": "0x8124Cbb807A7b64123F3dEc3EF64995d8B10d3Eb",
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "previousAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "AdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "beacon",
"type": "address"
}
],
"name": "BeaconUpgraded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "delegator",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "fromDelegate",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "toDelegate",
"type": "address"
}
],
"name": "DelegateChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "delegate",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "previousBalance",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "newBalance",
"type": "uint256"
}
],
"name": "DelegateVotesChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "Paused",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "id",
"type": "uint256"
}
],
"name": "Snapshot",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "Unpaused",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
},
{
"inputs": [],
"name": "DOMAIN_SEPARATOR",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "uint256",
"name": "snapshotId",
"type": "uint256"
}
],
"name": "balanceOfAt",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "burn",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "checkpoints",
"outputs": [
{
"internalType": "uint32",
"name": "fromTimePoint",
"type": "uint32"
},
{
"internalType": "uint256",
"name": "votes",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "subtractedValue",
"type": "uint256"
}
],
"name": "decreaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "delegatee",
"type": "address"
}
],
"name": "delegate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "delegatee",
"type": "address"
},
{
"internalType": "uint256",
"name": "nonce",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "expiry",
"type": "uint256"
},
{
"internalType": "uint8",
"name": "v",
"type": "uint8"
},
{
"internalType": "bytes32",
"name": "r",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "s",
"type": "bytes32"
}
],
"name": "delegateBySig",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "delegates",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "delegationNonces",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "delegatee",
"type": "address"
},
{
"internalType": "uint256",
"name": "nCheckpoints",
"type": "uint256"
}
],
"name": "getCheckpoint",
"outputs": [
{
"components": [
{
"internalType": "uint32",
"name": "fromTimePoint",
"type": "uint32"
},
{
"internalType": "uint256",
"name": "votes",
"type": "uint256"
}
],
"internalType": "struct BaalVotes.Checkpoint",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getCurrentSnapshotId",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "uint256",
"name": "timePoint",
"type": "uint256"
}
],
"name": "getPastVotes",
"outputs": [
{
"internalType": "uint256",
"name": "votes",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "getVotes",
"outputs": [
{
"internalType": "uint256",
"name": "votes",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "addedValue",
"type": "uint256"
}
],
"name": "increaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "mint",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "nonces",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "now",
"outputs": [
{
"internalType": "uint256",
"name": "timePoint",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "numCheckpoints",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pause",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "paused",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
},
{
"internalType": "uint8",
"name": "v",
"type": "uint8"
},
{
"internalType": "bytes32",
"name": "r",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "s",
"type": "bytes32"
}
],
"name": "permit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "proxiableUUID",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "name_",
"type": "string"
},
{
"internalType": "string",
"name": "symbol_",
"type": "string"
}
],
"name": "setUp",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "snapshot",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "snapshotId",
"type": "uint256"
}
],
"name": "totalSupplyAt",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "unpause",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
}
],
"name": "upgradeTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "upgradeToAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
}
]
}

View File

@ -1,233 +0,0 @@
{
"address": "0x7707964B4C24A6b8b7B747F7507F56818857A7C2",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "baal",
"type": "address"
},
{
"indexed": false,
"internalType": "uint32",
"name": "proposalId",
"type": "uint32"
},
{
"indexed": false,
"internalType": "address",
"name": "applicant",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "safe",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "EscrowReleased",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "baal",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "proposalId",
"type": "uint256"
}
],
"name": "TributeProposal",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "baal",
"type": "address"
},
{
"internalType": "uint256",
"name": "shares",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "loot",
"type": "uint256"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint32",
"name": "proposalId",
"type": "uint32"
},
{
"internalType": "address",
"name": "escrow",
"type": "address"
}
],
"name": "encodeTributeProposal",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "escrows",
"outputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "applicant",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "bool",
"name": "released",
"type": "bool"
},
{
"internalType": "address",
"name": "safe",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_baal",
"type": "address"
},
{
"internalType": "uint32",
"name": "_proposalId",
"type": "uint32"
}
],
"name": "releaseEscrow",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract Baal",
"name": "baal",
"type": "address"
},
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "shares",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "loot",
"type": "uint256"
},
{
"internalType": "uint32",
"name": "expiration",
"type": "uint32"
},
{
"internalType": "uint256",
"name": "baalgas",
"type": "uint256"
},
{
"internalType": "string",
"name": "details",
"type": "string"
}
],
"name": "submitTributeProposal",
"outputs": [],
"stateMutability": "payable",
"type": "function"
}
]
}

View File

@ -1 +0,0 @@
8453

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
100

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More