smartcontracts's People
smartcontracts's Issues
AletheaToken.sol and AletheaNoLoss.sol Security Audit
Alethea is aiming to build a decentralized marketplace for AI-generated media. We plan to launch our first product “Meme Pools” very soon, which basically takes the interest generated from a pool of DAI to sponsor the creation of AI-generated memes!
We also plan to mint our token soon. It would be great if any developers can review the smart contracts - your help will ensure the safe creation of the next generation of memes:
Token Contract (Rinkeby)
-
Uses OpenZeppelin libraries Mintable, Burnable, Pausable, and Detailed
-
Can only be minted and paused by wallets with minter/pauser roles (which can be given or removed at any time by the owner of the token contract)
-
An additional functionality was added to the OpenZeppelin MinterRole.sol so that a Cap can be set later on (by minters) to define the maxSupply upon which no more tokens can be minted (team prefers to have the ability to set this later on vs on deployment, thus not going with the Capped standard from OpenZeppelin)
-
The burning functionality can be used a) by users to burn their own tokens, and b) by smart contracts that have allowance to use certain tokens
Staking Contract (Rinkeby): Allows users to stake their DAI for a custom period of time and receive a custom amount of tokens as a rewards while their DAI interest is saved into the smart contract.
-
Contract owner(s) can update at any time the following variables:
tokenRewardAmount
,minDAIStakingTime
,minDAIStakingAmount
- plus the contract addresses fortoken
,dai
, andcDai
- owner(s) can also call the methodswithdrawDAI
andwithdrawToken
to withdraw anydai
/tokens
available on the contract, pluspauseContract
andunPauseContract
to pause/unpause interactions with the Staking Contract -
Users can call the methods:
a)stakeDAI
which sends usersdai
to the Compound protocol, atoken
reward to the user, andcDAI
to the smart contract
b)getDAIStakingInfo
to get their staking details and variables from the contract,
c)unstakeDAI
to get theirdai
plusavailableRewards
(this will updateamountRewarded
), and
d)claimRewards
to withdraw theiravailableRewards
from the Staking Contract
(c. and d. can only be called afterminDAIStakingTime
passes after the last time they staked) -
By staking
minDAIStakingAmount
users gets access to atoken
reward amount immediately and after that they are able toclaimRewards
every timeminDAIStakingTime
passes - astakedTimestamp
is saved/updated into the contract to keep track of the last time the user staked and properly calculateavailableRewards
-
The amount of
token
reward is calculated dividing a) the amount ofdai
staked by the user, for b) minDAIStakingAmount, and then multiplying the result for c)
tokenRewardAmount` -
The user can increase their
dai
staked anytime and at that point their available rewards are saved intoaccumulatedRewards
in order to keep an accurate count ofavailableRewards
(since the rewards depend not only on amount but also time staked)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.