943 views
# Team JUST Contract Libraries Team JUST has developed many standalone contracts that add value to the solidity development ecosystem. These are open-source and can be used by any Solidity developers: 1. **Dividends Bridge** - Adds an external dividend system from any contract back to P3D. ([See Contract](https://etherscan.io/address/0xC0c001140319C5f114F8467295b1F22F86929Ad0#code)) 2. **MultiSig** - Importable library that gives your contract the ability add multiSig requirement to functions. ([See Contract](https://etherscan.io/address/0x1974850db14d6B75322b56FC5febc2698d5F4120#code)) 3. **Name Filter** - Filtering and processing of name strings. ([See Contract](https://etherscan.io/address/0x4b7aC91b53545aE20A4990f9B5F6a14682dEEcBC#code)) 4. **UInt Compressor** - Compression library for uints. ([See Contract](https://etherscan.io/address/0xfE86A14626854F846457c2879F31B25076f2c9Fb#code)) 5. **Playerbook** - Unified library for mapping a wallet address to a unique name for the user. ([See Contract](https://etherscan.io/address/0xD60d353610D9a5Ca478769D371b53CEfAA7B6E4c#code)) ## SafeMath Library Check out the [code here](https://etherscan.io/address/0xd4b5556dAd4A0affc0eeF0Da56A928712E412180#code) for an improved safe math library. ## Dividends Bridge Check out the [code here](https://etherscan.io/address/0xC0c001140319C5f114F8467295b1F22F86929Ad0#code) for the dividends bridge. ``` * ┌──────────────────────────────────────────────────────────────────────┐ * │ Divies!, is a contract that adds an external dividend system to P3D. │ * │ All eth sent to this contract, can be distributed to P3D holders. │ * └──────────────────────────────────────────────────────────────────────┘ * ┌────────────────────┐ * │ Setup Instructions │ * └────────────────────┘ * (Step 1) import this contracts interface into your contract * * import "./DiviesInterface.sol"; * * (Step 2) set up the interface and point it to this contract * * DiviesInterface private Divies = DiviesInterface(0xC0c001140319C5f114F8467295b1F22F86929Ad0); * ┌────────────────────┐ * │ Usage Instructions │ * └────────────────────┘ * call as follows anywhere in your code: * * Divies.deposit.value(amount)(); * ex: Divies.deposit.value(232000000000000000000)(); */ ``` ## MultiSig Check out the [code here](https://etherscan.io/address/0x1974850db14d6B75322b56FC5febc2698d5F4120#code) for the dividends bridge. ``` * ┌──────────────────────────────────────────────────────────────────────┐ * │ MSFun, is an importable library that gives your contract the ability │ * │ add multiSig requirement to functions. │ * └──────────────────────────────────────────────────────────────────────┘ * ┌────────────────────┐ * │ Setup Instructions │ * └────────────────────┘ * (Step 1) import the library into your contract * * import "./MSFun.sol"; * * (Step 2) set up the signature data for msFun * * MSFun.Data private msData; * ┌────────────────────┐ * │ Usage Instructions │ * └────────────────────┘ * at the beginning of a function * * function functionName() * { * if (MSFun.multiSig(msData, required signatures, "functionName") == true) * { * MSFun.deleteProposal(msData, "functionName"); * * // put function body here * } * } * ┌────────────────────────────────┐ * │ Optional Wrappers For TeamJust │ * └────────────────────────────────┘ * multiSig wrapper function (cuts down on inputs, improves readability) * this wrapper is HIGHLY recommended * * function multiSig(bytes32 _whatFunction) private returns (bool) {return(MSFun.multiSig(msData, TeamJust.requiredSignatures(), _whatFunction));} * function multiSigDev(bytes32 _whatFunction) private returns (bool) {return(MSFun.multiSig(msData, TeamJust.requiredDevSignatures(), _whatFunction));} * * wrapper for delete proposal (makes code cleaner) * * function deleteProposal(bytes32 _whatFunction) private {MSFun.deleteProposal(msData, _whatFunction);} ``` ## Libraries and Contracts Directory Below is a directory of all the open-source libraries and contracts made available by Team JUST for use by any third-party developer: | Name | Description | Address | | -----| ----------- | ------- | | Updated Safemath | Safe math lib | [0xd4b5556dAd4A0affc0eeF0Da56A928712E412180](https://etherscan.io/address/0xd4b5556dAd4A0affc0eeF0Da56A928712E412180) | | Divvies Bridge | Sends dividends to P3D holders | [0xC0c001140319C5f114F8467295b1F22F86929Ad0](https://etherscan.io/address/0xC0c001140319C5f114F8467295b1F22F86929Ad0) | | Multi-sig | Allow for multi-sig commands | [0x1974850db14d6B75322b56FC5febc2698d5F4120](https://etherscan.io/address/0x1974850db14d6B75322b56FC5febc2698d5F4120) | | Name filter | Processes and transforms names | [0x4b7aC91b53545aE20A4990f9B5F6a14682dEEcBC](https://etherscan.io/address/0x4b7aC91b53545aE20A4990f9B5F6a14682dEEcBC) | | UInt Compressor | Compress UInts | [0xfE86A14626854F846457c2879F31B25076f2c9Fb](https://etherscan.io/address/0xfE86A14626854F846457c2879F31B25076f2c9Fb) | In addition, you can check out these relevant contracts as well: * [Older Divvies Bridge](https://etherscan.io/address/0xc7029Ed9EBa97A096e72607f4340c34049C7AF48) - This bridge pays the user's MN when activated * [Playerbook](https://etherscan.io/address/0xD60d353610D9a5Ca478769D371b53CEfAA7B6E4c) - Contract that records usernames associated with a wallet address * [Team JUST Contract](https://etherscan.io/address/0x464904238b5CdBdCE12722A7E6014EC1C0B66928) - Example of how to use multsig library to make a universal team management contract that can grant roles ## MIT License MIT License, Copyright (c) 2018 Team JUST Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.