I'm wondering how the code might look/if it's possible to use the Safe Core SDK to deploy a safe, then vote on a Snapshot proposal? Suppose I have a safe, successfully created with:
const safe = await safeFactory.deploySafe({
{ owners, threshold },
saltNonce,
callback: (hash) =>
console.log(`Tx hash: ${hash}`),
});
And I can create the snapshot client:
const client = new snapshot.Client712('https://testnet.hub.snapshot.org');
How might I modify this example (from the snapshot docs), to vote with the safe I've created?
const web3 = new Web3Provider(window.ethereum);
const [account] = await web3.listAccounts();
const receipt = await client.vote(web3, account, {
space: 'yam.eth',
proposal: '0x21ea31e896ec5b5a49a3653e51e787ee834aaf953263144ab936ed756f36609f',
type: 'single-choice',
choice: 1,
reason: 'Choice 1 make lot of sense',
app: 'my-app'
});
I assume the account
would be the address of the deployed safe, and in my case I am not creating a provider from window.ethereum
, rather new ethers.providers.JsonRpcProvider
using an Alchemy RPC endpoint.