Hi, I’m trying to launch a token via ICO that is trustless. Is there a design pattern to do the following:
I launch ICO contract
Investors send ETH to ICO contract
ICO contract query chainlink price oracle for ETH and saves USD value associated with investor address
Payout function that gives me the investor ETH automatically launches an ERC-20 token with rules established by a library contract and distributes the tokens proportionally to the USD value provided by the investors?
The crowdsale contracts accept Ether and distribute ERC20 tokens.
If you are pricing your tokens in a fiat currency rather than Ether, you could create your own contract based on these concepts that accepts a stable coin as payment instead.