
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@unizen-io/unizen-dmas
Advanced tools
Smart contracts of the Dynamic Multi Asset Staking (DMAS) of Unizen.
A modified version of the Synthetix and Curve.fi staking rewards contracts, allowing for multiple rewards tokens.
The Staking contract in this repository enables distribution of multiple reward tokens for staked users. It is a flattened and modified version of the Curve.fi staking rewards contract.
As an example, assume we desire users to stake an ERC20 Token Base Token ($BASE). As a reward for staking their token, we may wish to offer users multiple different tokens. For the sake of this example, we'll assume we have two different amount of governance tokens, Reward Token 1 ($ONE) and Reward Token 2 ($TWO), which we want to release over different schedules.
Staking contract with a link to $BASE as our staking token.addReward
addReward, Owner also specifies the duration of the reward period (in seconds)notifyRewardAmount, which transfers the specified amount of reward tokens from their address to the contract and begins the reward cycle.stake, and will then accrue $ONE and $TWO throughout the duration of the rewards period.getReward.withdraw. At this point they can still claim any accumulated unclaimed $ONE and $TWO rewards through the getReward endpoint but will not longer accrue rewards.Keep the following in mind when using the Staking contract:
setRewardsDuration only after the active reward cycle has completed.stake, withdraw, , getReward, or notifyRewardAmount)recoverERC20 to transfer reward tokens, but not the staking token. Claiming rewards may fail if this function drains the balance.approve function on the token's contract and authorize Staking to transfer the correct amount.To see the mnemonic or seed phrase in Metamask, follow this instruction.
The Metamask account (mnemonic in the .env) needs to have enough funds in the network where you want to interact with the smart contracts.
To add test funds:
cp .env.example .env
vi .env # add an account's mnemonic and an Infura API key
yarn install
yarn build
yarn hardhat:node
yarn install
yarn build
yarn deploy:rinkeby
npm login
yarn publish --access public
yarn create-reward-pools
Installing via npm package:
yarn add @unizen-io/unizen-dmas
Import in a UI component like so:
import { UZStakingV1, UZStakingV1__factory } from "unizen-dmas";
FAQs
Smart contracts of the Dynamic Multi Asset Staking (DMAS) of Unizen.
The npm package @unizen-io/unizen-dmas receives a total of 28 weekly downloads. As such, @unizen-io/unizen-dmas popularity was classified as not popular.
We found that @unizen-io/unizen-dmas demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.