Closed 0xbok closed 2 years ago
I dont see any negative consequence due to this. Do you have any concern?
On Sat, Nov 26, 2022 at 2:50 AM calvbore @.***> wrote:
@.**** commented on this pull request.
In src/DittoMachine.sol https://github.com/ditto-lab/ditto/pull/86#discussion_r1032689426:
- function bumpSubsidy(address nft, uint id, address ERC20Contract, bool floor, uint128 amount) external {
- uint protoId = uint(keccak256(abi.encodePacked(
- nft,
- id,
- ERC20Contract,
- false
- )));
- uint cloneId = protoIdToIndexHead[protoId];
- assembly ("memory-safe") {
- mstore(0, protoId)
- mstore(0x20, cloneId)
- cloneId := keccak256(0, 0x40)
- }
- SafeTransferLib.safeTransferFrom(
- ERC20(ERC20Contract),
- msg.sender,
- address(this),
- amount
- );
- cloneIdToSubsidy[cloneId] += amount;
- }
Just something to consider here, but do we want to allow anyone to increase the subsidy of a clone?
— Reply to this email directly, view it on GitHub https://github.com/ditto-lab/ditto/pull/86#pullrequestreview-1194773628, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM4POYKA7H7WHAZUCZIKHDWKEUSPANCNFSM6AAAAAARQ5JGYM . You are receiving this because you authored the thread.Message ID: @.***>
@0xbok lgtm
PR to get early feedback. Current flow (we can change it as needed):
FallbackReceiver
.claim()
to send that nft to the clone owner.sell()
to sell the nft to ditto (floor
is set tofalse
).FallbackReceiver
through this trade is passed back to the subsidy pool of thecloneId
(derived throughfloor==false
) by callingDittoMachine.bumpSubsidy()
Bug fix: pass correct index in return data on nft receiver function in dittomachine.