contracts.demo's People
contracts.demo's Issues
use better temp dir
Using “origin" parameter may be a vulnerability
Currently some function (addToken and depositETH) in FluidexDemo contract has induced a "origin" parameter for being called from delegator contract. When called inside the delegator contract, the msg.sender of delegator contract it passed and being considered as the "original caller" of such an action. Such a practice may become problematic because:
-
The method which accepts origin argument has no ability to check if it was passed by expected: in case a malicious contract or address has been assigned with delegator role, they can forge any address which can pass the privilege checking of origin argument inside these methods.
-
The msg.sender is not the real tx caller if the delegator contract is called from another contract or proxy. In this case, the privilege checking is failed even a user with required privilege really call them.
There is tx.origin in solidity which indicate the sender of the transaction for the full calling chain. Maybe we should use the variant rather an additional "origin" parameter?
assert vs require vs return
check address is ERC20 when add new token
contracts call error
eth_estimateGas
Contract call: FluidexDemo#submitBlock
From: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
To: 0x5fbdb2315678afecb367f032d93f642f64180aa3
Value: 0 ETH
Error: VM Exception while processing transaction: invalid opcode
at FluidexDemo.submitBlock (contracts/Fluidex.sol:38)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at EthModule._estimateGasAction (/home/chris/gitfiles/fluidex/fluidex-backend/contracts/node_modules/hardhat/src/internal/hardhat-network/provider/modules/eth.ts:421:9)
at HardhatNetworkProvider._sendWithLogging (/home/chris/gitfiles/fluidex/fluidex-backend/contracts/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:126:22)
at HardhatNetworkProvider.request (/home/chris/gitfiles/fluidex/fluidex-backend/contracts/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:103:18)
at JsonRpcHandler._handleRequest (/home/chris/gitfiles/fluidex/fluidex-backend/contracts/node_modules/hardhat/src/internal/hardhat-network/jsonrpc/handler.ts:188:20)
at JsonRpcHandler._handleSingleRequest (/home/chris/gitfiles/fluidex/fluidex-backend/contracts/node_modules/hardhat/src/internal/hardhat-network/jsonrpc/handler.ts:167:17)
at Server.JsonRpcHandler.handleHttp (/home/chris/gitfiles/fluidex/fluidex-backend/contracts/node_modules/hardhat/src/internal/hardhat-network/jsonrpc/handler.ts:52:21)
when using c36e354
use dotenv for ENV
TODO: migrate plonk_core as library/interface
add `addToken`, `registerUser`, `depositETH` and `depositERC20`
align solidity version
use aligned solidity version.
We may also want to update plonkit's template
add admin account
style: seems `camelCaseFunctionName` is more common
get deployed_address
npx hardhat run scripts/deploy.js --network localhost | grep "Fluidex deployed to:" | awk '{print $4}'
TODO: hash inputs before passing into plonk_verify
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.