npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@murphy-labs/strateg-protocol-sopt

v0.0.48

Published

StrategOperatingPaymentToken is a Solidity smart contract that extends the functionality of ERC20 tokens with additional features to facilitate payments and allowances for specific Strateg infrastructure operations. It allows users to establish operation

Downloads

44

Readme

StrategOperatingPaymentToken Smart Contract

StrategOperatingPaymentToken is a Solidity smart contract that extends the functionality of ERC20 tokens with additional features to facilitate payments and allowances for specific Strateg infrastructure operations. It allows users to establish operation allowances to strateg vaults or position manager. The contract is based on the OpenZeppelin library, ensuring security and reliability through widely tested and audited code.

Features

  1. ERC20 Token Functionality: This smart contract inherits from the OpenZeppelin's ERC20Upgradeable contract, providing all the standard ERC20 token functionalities like transfer, transferFrom, and balanceOf.

  2. Permit Functionality: The contract also utilizes the ERC20PermitUpgradeable extension to enable users to approve allowances for an operation using a permit function, allowing for a gasless approval process.

  3. Burn Functionality: The contract includes the ERC20BurnableUpgradeable extension, allowing token holders to burn their tokens, removing them from the circulating supply.

  4. Ownable: The contract inherits from OwnableUpgradeable, which ensures that only the contract's owner has the ability to set the operator proxy and payment fee.

Getting Started

To deploy and interact with this smart contract, follow these steps:

  1. Make sure you have a compatible development environment, such as Remix, Truffle, or Hardhat.

  2. Set the SPDX-License-Identifier in the smart contract file to the desired license.

  3. Ensure you have the OpenZeppelin library installed. The contract imports several contracts from the OpenZeppelin library:

    • @openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol
    • @openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol
    • @openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol
    • @openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol
    • @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
  4. Deploy the contract to your desired Ethereum network.

Usage

  1. Initialize the Contract: After deploying the contract, call the initialize function with the desired name and symbol for the ERC20 token.

  2. Set Operator Proxy: Only the owner of the contract can set the operator proxy by calling the setOperatorProxy function and providing the address of the proxy.

  3. Set Payment Fee: The contract owner can set the payment fee (in basis points) by calling the setPaymentFee function.

  4. Mint Tokens: Users can mint tokens to their address by sending Ether to the mint function. The amount of Ether sent will be converted to tokens.

  5. Burn Tokens: Users can burn their tokens by calling the burn function with the desired token amount.

  6. Approve Operation: Users can approve an operator to spend tokens on their behalf for a specific operation using the approveOperation function.

  7. Execute Payment: The operator proxy can execute a payment on behalf of a user by calling the executePayment function, providing the payer's address, the recipient's address, the operator's address, and the payment amount. The payment amount will be deducted from the payer's balance, and a configurable payment fee will be deducted and sent to the contract owner.

Error Handling

The contract includes three custom errors:

  1. NotOperator: Thrown when an other address than the operator proxy tries to execute a payment.

  2. InsufficientPaymentAllowance: Thrown when the operation allowance is insufficient for the requested payment.

  3. PaymentExceedsBalance: Thrown when the payer's balance is insufficient to execute the payment.

Security

This contract is built using the well-audited and tested OpenZeppelin library, which provides a solid foundation for secure smart contract development. However, as with any smart contract, it is essential to conduct thorough testing and security audits before deploying it to the mainnet.

Please exercise caution and ensure that the contract is appropriately audited before deploying it in a production environment.

License

This smart contract is licensed under the MIT License (SPDX-License-Identifier: MIT).

Note: Ensure to verify and audit the smart contract carefully before using it in any production environment. This README.md provides a high-level overview and does not cover all possible edge cases and vulnerabilities.