Ethereum: How do I pass signers when enabling module for my safe?

Avatar de admin

Here is an article based on the documentation you have given:

Enabling multiple signatories to a safe with Ettherem

In this guide we will have the procedure of enabling multiple signatories to make safe use

Prerequisites*

To use more signatories in your safe, you first created a new instance of the «Safe» class instance and defined. In this example, we will assume that it will work with simple multisig settings that one signatory can attach to additional signatories.

First make installation of the installation of the required library:

`Bash

NPM Install @safe-global

`

Creating a new safe instance

Create NewfixSEF.JS ‘and add the next code to define an instance:

`Javascript

Import {Safe} from '@safe-global';

Const Mysafe = new safe ({{

// Define your multisig

Type: 'Multisig',

Name: 'My Multisig Test',

Publicky: 'YouRPUBLLICKEY', // Plant with valid public patterns

Privatekey: 'Yourprivatekey', // Equipment with Valid Privatekey

// Enable multiple signatories

Onblemultiplesigners: True,

Numsigners: {{

Approved Kysygners: 2, // Number of signatories Dodici may allow the transaction to be attracted

Mozhlo

});

In this example, we have defined the multisig for your safenumsignersset up for a { {{{{{{{{{{{}: 2} . This signatory (SEFA creator) may approve of two additional signatories.

Creating signatories

In this multiple, you will need to generate new signing keys and add

For this example, assume that we have a private key calledPrivatekey ‘we will use. We can also generate additional signatories using the following code:

`Javascript

Const {Privatekey, Publickey} = Waiting for GetPrivatekeyandpublkyy ();

To this new signatory without a specifications name and a public key, you can follow the following code:

Javascript

Const Newsigner = Wait for Gettnewsigner ({{{

ID: 'New signatory',

Name: 'John Doe', // Equipment with a valid name

Publicky: 'YouRPUBLLICKEY', // Plant with valid public patterns

});

Passing signatories to SEF

Ethereum: How do I pass signers when enabling module for my safe?

To transfer the signatures to your safe, you will need to create a new transaction that includes the necessary information (eg, the names of the signatories and the Billic keys). In this example, assume that we have a simple function ofCreatransation:

Javascript

Const Creatransation = Async (Transactionation) => {

Const signature = Wait for Getsignerinrinfo (transactionaconfig.signers);

// Use the signatorial data to construct a transaction

Const transaction = new transaction (signatory, transactioncunfig);

return transaction;

};

To transfer the signature to your safe, we can take a new transaction and include the public key to the signator:

Javascript

Const 15

Type: 'transaction',

Inputs: [],

Exits: [], // add exit if any

// Turn the signator in the transaction

Signatics: [Newsigner.publiscy],

});

In this example, we have attributed a new transaction and included your "Newsigner" public as one of the signatories. We can do this to be able to approve of multiple transactions.

all that together

To use multiple in your safe, you will create a new instance of instance. Here's an example of a house you can put together:

` Javascript

Import {Safe} from ‘@safe-global’;

Import of getprivekeyandpublkyy from ‘./getprivatekeyandpublkyy’;

Import {cratetraransation} from ‘.

ethereum need bitcoins

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *