Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
defender-admin-client
Advanced tools
Defender Admin acts as an interface to manage your smart contract project through one or more secure multi-signature contracts. Defender Admin holds no control at all over your system, which is fully controlled by the keys of the signers.
Defender Admin acts as an interface to manage your smart contract project through one or more secure multi-signature contracts. Defender Admin holds no control at all over your system, which is fully controlled by the keys of the signers.
To interact with your contracts, you create proposals that need to be reviewed and approved by the other members of the multi-signature wallets. These proposals can be created directly in the Defender web application, or using this library.
npm install defender-admin-client
yarn add defender-admin-client
Start by creating a new Team API Key in Defender, and granting it the capability to create new proposals. Use the newly created API key to initialize an instance of the Admin client.
const { AdminClient } = require('defender-admin-client');
const client = new AdminClient({apiKey: API_KEY, apiSecret: API_SECRET});
To create a custom
action proposal, you need to provide the function interface (which you can extract from the contract's ABI), its inputs, and the multisig that will be used for approving it:
await client.createProposal({
contract: { address: '0x28a8746e75304c0780E011BEd21C72cD78cd535E', network: 'rinkeby' }, // Target contract
title: 'Adjust fee to 10%', // Title of the proposal
description: 'Adjust the contract fee collected per action to 10%', // Description of the proposal
type: 'custom', // Use 'custom' for custom admin actions
functionInterface: { name: 'setFee', inputs: [{ type: 'uint256', name: 'fee' }] }, // Function ABI
functionInputs: ['10'], // Arguments to the function
via: '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b', // Multisig address
viaType: 'Gnosis Safe', // Either Gnosis Safe or Gnosis Multisig
});
To create an upgrade
action proposal, just provide the proxy contract network and address, along with the new implementation address, and Defender will automatically resolve the rest:
const newImplementation = '0x3E5e9111Ae8eB78Fe1CC3bb8915d5D461F3Ef9A9';
const contract = { network: 'rinkeby', address: '0x28a8746e75304c0780E011BEd21C72cD78cd535E' }
await client.proposeUpgrade({ newImplementation }, contract);
If you create a new proposal for a Contract that has not yet been added to Defender Admin, it will be automatically added with an autogenerated name and an empty ABI. You can optionally control these values by providing values for them in the contract
object of the proposal:
const contract = {
network: 'rinkeby',
address: '0x28a8746e75304c0780E011BEd21C72cD78cd535E',
name: 'My contract', // Name of the contract if it is created along with this proposal
abi: '[...]', // ABI to set for this contract if it is created
};
await client.proposeUpgrade({ newImplementation }, contract);
Note that, if the contract already exists in Defender Admin, then name
and abi
will be ignored.
FAQs
Defender Admin acts as an interface to manage your smart contract project through one or more secure multi-signature contracts. Defender Admin holds no control at all over your system, which is fully controlled by the keys of the signers.
The npm package defender-admin-client receives a total of 178 weekly downloads. As such, defender-admin-client popularity was classified as not popular.
We found that defender-admin-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.