要建立一个多方签名合约,首先需要再gui中填入最小签名数量和公钥列表。点击确定后调用代码如下:
private void 多方签名MToolStripMenuItem_Click(object sender, EventArgs e)
{
using (CreateMultiSigContractDialog dialog = new CreateMultiSigContractDialog())
{
if (dialog.ShowDialog() != DialogResult.OK) return;
Contract contract = dialog.GetContract();
if (contract == null)
{
MessageBox.Show(Strings.AddContractFailedMessage);
return;
}
WalletAccount account = Program.CurrentWallet.CreateAccount(contract, dialog.GetKey());
if (Program.CurrentWallet is NEP6Wallet wallet)
wallet.Save();
listView1.SelectedIndices.Clear();
AddAccount(account, true);
}
}
这里首先会获取签名数量m和公钥列表publicKeys,然后调用CreateMultiSigContract()