mattlockyer / composables-998 Goto Github PK
View Code? Open in Web Editor NEWAn implementation and documentation repo for developing the ERC-998 standard for Ethereum.
License: MIT License
An implementation and documentation repo for developing the ERC-998 standard for Ethereum.
License: MIT License
Why was 998 the contract split and renamed in two? Top down and bottom up. Doesn't make much sense to me both conceptually (only the parent should be composable) and in terms of the naming. Parent should be parent. Child should be child and may have a separate extra interface to communicate with the parent. I suggest to rename ERC998ERC721TopDown back to simply ERC998. And have ERC998Child interface if you want to have extra logic for the children, callbacks from the parents, etc. Like look at what ERC721 done with ERC721 and ERC721Receiver.
Per discussion in the 2nd Composables call, creating "to do" items in Github Issues for areas where we could use help from devs who want to contribute.
onERC721Received calls the childReceived function which writes 5 words to storage which costs 100,000 gas. But the ERC721 standard requires that the onERC721Received function use no more than 50,000 gas
I am really liking composable NFTs!
I noticed that the childReceived function will add duplicate contracts to childContracts[_tokenId]
if multiple tokens from the same contract are transferred. When this happens the childContractsOwnedBy
will return duplicate contracts, and this will cause other problems in the contract.
It seems that if a contract has already been added to childContracts[_tokenId]
then it should not be added again.
Per discussion in the 2nd Composables call, creating "to do" items in Github Issues for areas where we could use help from devs who want to contribute.
Trying to build this project so I can extend it, but it does not migrate...
Truffle config:
module.exports = {
compilers: {
solc: {
version: "0.4.24", // Fetch exact version from solc-bin (default: truffle's version)
// docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
settings: { // See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: false,
runs: 200
},
evmVersion: "homestead"
}
}
},
networks: {
development: {
host: "127.0.0.1",
port: 7545,
//gas: 8000000,
network_id: "*" // Match any network id
}
}
};
The migrations file is unchanged, but will not deploy...
const Migrations = artifacts.require("./Migrations.sol");
const Composable = artifacts.require("./ComposableTopDown.sol");
const SampleNFT = artifacts.require("./SampleNFT.sol");
const SampleERC20 = artifacts.require("./SampleERC20.sol");
module.exports = function(deployer) {
deployer.deploy(Migrations);
//deployer.deploy(Composable, "ComposableTopDown", "COMPTD", {gas: 8000000});
deployer.deploy(Composable, "ComposableTopDown", "COMPTD");
deployer.deploy(SampleNFT, "SampleNFT", "SNFT");
deployer.deploy(SampleERC20);
};
The error message I get is
1_initial_migration.js
======================
Replacing 'Migrations'
----------------------
> transaction hash: 0x157a6d4092b3290d2ac633726162844c5f9551b4cb5bb18b43dde72bc4798345
> Blocks: 0 Seconds: 0
> contract address: 0xb98c7CDE39CA5687e673BE940287A80DBFC98E6e
> block number: 15
> block timestamp: 1639655894
> account: 0xA9981301919D090b015eDF55a84FE0072A25ba28
> balance: 99.82268304
> gas used: 238174 (0x3a25e)
> gas price: 20 gwei
> value sent: 0 ETH
> total cost: 0.00476348 ETH
Deploying 'ComposableTopDown'
-----------------------------
Error: *** Deployment Failed ***
"ComposableTopDown" ran out of gas. Something in the constructor (ex: infinite loop) caused gas estimation to fail. Try:
* Making your contract constructor more efficient
* Setting the gas manually in your config or as a deployment parameter
* Using the solc optimizer settings in 'truffle-config.js'
* Setting a higher network block limit if you are on a
private network or test client (like ganache).
at C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\deployer\src\deployment.js:365:1
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at Migration._deploy (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:70:1)
at Migration._load (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:56:1)
at Migration.run (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:217:1)
at Object.runMigrations (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:150:1)
at Object.runFrom (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:110:1)
at Object.runAll (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:114:1)
at Object.run (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:79:1)
at runMigrations (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:258:1)
at Object.run (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:223:1)
at Command.run (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\command.js:183:1)
Truffle v5.4.11 (core: 5.4.11)
Node v14.17.5
Per discussion in the 2nd Composables call, creating "to do" items in Github Issues for areas where we could use help from devs who want to contribute.
Per discussion in the 2nd Composables call, creating "to do" items in Github Issues for areas where we could use help from devs who want to contribute.
This question comes from the 3rd Composables call.
How to npm install
and truffle test
without package.json
?
Per discussion in the 2nd Composables call, creating "to do" items in Github Issues for areas where we could use help from devs who want to contribute.
This question comes from the 3rd Composables call.
I cloned the repo and ran npm i followed by truffle test.
I am getting the following error - Error: while migrating ComposableTopDown: Returned error: VM Exception while processing transaction: out of gas
Truffle v5.1.25 (core: 5.1.25)
Node v10.16.3
Solidity Compiler Version - 0.4.24
Please advise.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.