Comments (8)
If the factory contract used CREATE2, I think someone could front run a transaction's salt and steal the address. So you'd have to wait for a few confirmations before sending any funds.
from clone-factory.
If the factory contract used CREATE2, I think someone could front run a transaction's salt and steal the address. So you'd have to wait for a few confirmations before sending any funds.
Not true, CREATE2 uses the deployer address in computing the resulting contract address
edit: not sure exactly what situation you are describing
from clone-factory.
from clone-factory.
Oh, I am using a version of the minimal proxy in a library and calling it from a contract.
from clone-factory.
@moodysalem I've published a create2 implementation here: https://github.com/solidstate-network/solidstate-contracts/blob/master/contracts/architecture/factory/MinimalProxyFactory.sol
Note that it's in a pre-release state, and not to be completely trusted. It is also likely to not be as minimal as possible. I still need to test the gas consumption.
from clone-factory.
from clone-factory.
If the factory contract used CREATE2, I think someone could front run a transaction's salt and steal the address.
I think that this issue could be circumvented by hashing the tx.origin
with the user-provided salt, and passing the resultant hash as the salt to create2
.
Note that it should be tx.origin
rather than msg.sender
because the issue would not otherwise be mitigated for factory contracts.
from clone-factory.
Looks like OpenZeppelin added support for CREAT2-enabled minimal proxies in their Clones.sol
contract:
from clone-factory.
Related Issues (20)
- Action required: Greenkeeper could not be activated 🚨
- EIP-1167 - Minimal Proxy Contract HOT 38
- Requirements on library and which factory to choose HOT 6
- Odd behaviour with msg.sender HOT 2
- Should not destroy cloned contract HOT 1
- Include in OpenZeppelin? HOT 2
- Use in production? HOT 5
- Why so many clone factory contracts? HOT 3
- Immutably owned clones HOT 3
- failure of the delegatecall should revert with return data
- Update for newer Solidity version HOT 1
- Estimate right amount of gas to receive ether
- Are custom errors bubbled up too?
- Settle on either "package-lock.json" or "yarn.lock"
- Outdated version of Solidity compiler version. HOT 2
- I can't call this function
- Use returndatasize HOT 1
- How would one update the address the proxy is using? HOT 11
- Implementation on Rinkeby HOT 2
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.
from clone-factory.