---
# System prepended metadata

title: vault safe Module transaction

---

# vault safe Module transaction

Add baal as module on outside vault safe. this will have to be approved by a current signer

the proposal transaction is comprised of three steps.
- transaction you want the vault to do
- execTransactionFromModule on safe
- executeAsBaal for proposal data

```
// tx to transfer wxdai to dao treasury safe
      const transferToken = await lootToken.interface.encodeFunctionData(
        "transfer",
        ["0xf593086cb713fdf85474ed231cc0db8222cf7058", "1000000000000000000"]
      );

      // execute transfer from module
      const safetx = await gnosisSafe1.interface.encodeFunctionData(
        "execTransactionFromModule",
        ["0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d", 0, transferToken, 0]
        )

// create proposal data
      const transferprop = baal.interface.encodeFunctionData(
          "executeAsBaal",
          ["0x2d413Fa9B9D8c62487892889f702bC695A139F86", 0, safetx]
        );

      console.log('proposal1', transferprop);
```



example:
https://admin.daohaus.fun/#/molochV3/0x64/0x68ee75440c79e6395880ea8009c9307432e5630b/proposals/16


### 2nd experiment

```

const wxDaiTransfer = (new ethers.utils.Interface([
  'function transfer(address, uint256)',
])).encodeFunctionData(
  'transfer',
  [
      '0xb0a6fcf7b1de57cdea9778041d83ce1e0cd4bb85', // Baal "native" vault
      '1000000000000000000',
  ],
);

const execFromModule = (new ethers.utils.Interface([
  'function execTransactionFromModule(address, uint256, bytes, uint8)',
])).encodeFunctionData(
  'execTransactionFromModule',
  [
      '0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d', // wxdai
      '0',
      wxDaiTransfer,
      '0',
  ], 
);

const execAsBaal = (new ethers.utils.Interface([
  'function executeAsBaal(address, uint256, bytes)'
])).encodeFunctionData(
  'executeAsBaal',
  [
      '0x230707931998D20aeAf960D76386727274B3C585', // external Safe with baal as a module
      '0',
      execFromModule,
  ], 
);
    
return {
    to: '0xd5fd77c974776ce3c11c46ab67d8e2eb028b82d2', // Baal
    data: execAsBaal,
    value: '0',
    operation: '0',
}
```

Internally, returned MetaTx is sent as array to `encodeMultiAction`:

```
return encodeFunction(LOCAL_ABI.GNOSIS_MULTISEND, 'multiSend', [
    encodeMultiSend(rawMulti), // from '@gnosis.pm/safe-contracts'
]);
```

Finally, returned data is sent as param to `Baal.submitProposal`

Example: https://admin.daohaus.fun/#/molochV3/0x64/0xd5fd77c974776ce3c11c46ab67d8e2eb028b82d2/proposals/1